https://wiki.archlinux.org/api.php?action=feedcontributions&user=Georgek&feedformat=atomArchWiki - User contributions [en]2024-03-28T20:40:38ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:Georgek&diff=30958User:Georgek2007-10-16T08:53:04Z<p>Georgek: aspell: we will modify ru.multi</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru", so we will modify ru.multi.<br />
<br />
cd /usr/lib/aspell<br />
grep '^special' en.dat >>ru.dat<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru --encoding=UTF-8 create master ruen.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add ruen.rws" > ru.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30957User:Georgek2007-10-16T08:51:07Z<p>Georgek: aspell: fix all</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/lib/aspell<br />
grep '^special' en.dat >>ru.dat<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru --encoding=UTF-8 create master ruen.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add ruen.rws" > ru.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30956User:Georgek2007-10-16T08:45:06Z<p>Georgek: aspell: add encoding</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/lib/aspell<br />
grep '^special' en.dat >>ru.dat<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru --encoding=UTF-8 create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30955User:Georgek2007-10-16T08:41:50Z<p>Georgek: aspell: delete second cd /usr/lib/aspell</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/lib/aspell<br />
grep '^special' en.dat >>ru.dat<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30954User:Georgek2007-10-16T08:41:11Z<p>Georgek: aspell: grep '^special'</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/lib/aspell<br />
grep '^special' en.dat >>ru.dat<br />
cd /usr/lib/aspell<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30953User:Georgek2007-10-16T08:40:14Z<p>Georgek: aspell: cd /usr/lib/aspell</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/lib/aspell<br />
grep ^special en.dat >>ru.dat<br />
cd /usr/lib/aspell<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=30952User:Georgek2007-10-16T08:36:52Z<p>Georgek: /* My playground */</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== Snatches ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/share/aspell<br />
grep ^special en.dat >>ru.dat<br />
cd /usr/lib/aspell<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=Improve_pacman_performance&diff=30555Improve pacman performance2007-10-11T18:04:47Z<p>Georgek: Fix aria2c presence check</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:Customizing (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
<br />
= Improving database access speeds =<br />
<br />
Pacman stores all package information in a collection of small files, one for each package. Improving database access speeds reduces the time taken in database-related tasks, e.g. searching packages and resolving package dependencies.<br />
<br />
The safest and easiest method is to run<br />
<br />
pacman-optimize<br />
<br />
as root. This will attempt to put all the small files together in one (physical) location on the hard disk so that the hard disk head does not have to move so much when accessing all the packages. This method is safe, but is not for-sure. It depends on your filesystem, disk usage and empty space fragmentation.<br />
<br />
=== Further tweaks ===<br />
'''ody''' has posted [http://bbs.archlinux.org/viewtopic.php?t=20385 a script on the forum] that replaces the current Pacman database with a ''loopback filesystem'' which ensures that all the small files continue to stay together on the hard disk. Several users have reported great improvements, but problems have also been reported so do not do this unless you are an expert user. <br />
<br />
To use '''ody''''s script you must have a kernel compiled with loopback filesystem support. The default kernels already have this, so you only need to be concerned with this if you compile your own custom kernel.<br />
<br />
= Improving download speeds =<br />
<br />
Firstly, if your download speeds have been reduced to a crawl, ensure you are using one of the many [[mirrors]] and not ftp.archlinux.org, which, [http://www.archlinux.org/news/302/ as of March 2007], is now throttled.<br />
<br />
Pacman's speed in downloading packages can be improved by using a different application to download packages instead of Pacman's built-in file downloaded.<br />
<br />
In all cases, make sure you have the latest Pacman before doing any modifications.<br />
<br />
pacman -Sy pacman<br />
<br />
=== Using wget ===<br />
<br />
This is also very handy if you need more powerful proxy settings than pacman's built-in capabilities. <br />
<br />
To use <code>wget</code>, first install it with <code>pacman -S wget</code> and then modify <code>/etc/pacman.conf</code> by adding the following line to the <code>[options]</code> section:<br />
<br />
XferCommand = /usr/bin/wget -c --passive-ftp -c %u<br />
<br />
Instead of putting <code>wget</code> parameters in <code>/etc/pacman.conf</code>, you can also modify the <code>wget</code> configuration file directly (the system-wide file is <code>/etc/wgetrc</code>, per user files are <code>$HOME/.wgetrc</code>).<br />
<br />
<br />
=== Using aria2 ===<br />
<br />
According to the aria2 website, aria2 is "a download utility with resuming and segmented downloading. Supports HTTP/HTTPS/FTP/BitTorrent/Metalink." This means that you can make several HTTP/FTP connections to an Arch mirror at the same time, which should result in an increase in download speeds.<br />
<br />
Install it with <code>pacman -S aria2</code> and then edit <code>/etc/pacman.conf</code> by adding the following line to the <code>[option]</code> section:<br />
<br />
XferCommand = /usr/bin/aria2c -s 2 -m 2 -o %o %u<br />
<br />
Let's run over the options here:<br />
* ''/usr/bin/aria2c'' - the location of the aria2 application<br />
* ''-s 2'' - use 2 concurrent connections (you can set this higher if you want, but it's not going to do a whole lot)<br />
* ''-m 2'' - make 2 attempts to download the package per mirror<br />
* ''-o %o'' - output to the file pacman specifies<br />
* ''%u'' - download the file pacman specifies<br />
<br />
<br />
==== Aria2 Mirror Script ====<br />
<br />
This script will greatly improve the download speed for broadband users. It takes the download URL from pacman, then looks up the mirror list in /etc/pacman.d/<repo> and adds them all as mirrors to aria2. What ends up happening is aria2 connects to 10-20 servers (the default is 4 servers max) downloading from all of them at the same time, which should give anyone on broadband a huge boost in download speed. This should max out the download speed for most people.<br />
<br />
Take note that you have to put 'exec' before /usr/bin/pacget in the XferCommand. This is needed so that when you terminate pacget or aria2 (with process id used by pacget), pacman would also terminate. This would prevent "inconvenience" because Pacman would not persist downloading a file when you tell it not to.<br />
<br />
WARNING: You may experience a lot of problems when you become greedy. Just choose a handful of reliable servers (5 is already a lot) that syncs regularly with the master server. Do NOT choose out-of-date mirrors as these may cause problems like corrupted downloads, etc. Also, ftp.archlinux.org resolves to two IPs. You may want to choose only one of them and hard code ftp.archlinux.org and the chosen IP address to /etc/hosts<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
# ------------ Begin Configuration ------------ #<br />
<br />
# The log file<br />
LOG=/var/log/pacget.log<br />
# Number of connections per server (don't go beyond 2, please)<br />
CONNECTIONS=2<br />
# Max number of servers to download from (follows ordering in include file)<br />
SERVERS=4<br />
# Maximum download speed (0 = unrestricted)<br />
MAX_SPEED=0<br />
# Minimum download speed (0 = don't care)<br />
MIN_SPEED=0<br />
# Maximum tries per download<br />
MAX_TRIES=2<br />
# Server timeout period<br />
TIMEOUT=15<br />
# Passive FTP or not: 'yes' or 'no'<br />
FTP_PASV="no"<br />
# 'none' or 'prealloc'<br />
FILE_ALLOC="none"<br />
# Use color in messages<br />
USE_COLOR="yes"<br />
<br />
# ------------- End Configuration ------------- #<br />
<br />
msg() {<br />
echo ""<br />
if [ "${USE_COLOR}" = "yes" ]; then<br />
echo -ne " \033[1;34m->\033[1;0m \033[1;1m${1}\033[1;0m" >&2<br />
else<br />
echo -n " -> ${1}" >&2<br />
fi<br />
}<br />
<br />
ARIA2_BIN=$(which aria2c 2> /dev/null)<br />
<br />
if [ ! -x "$ARIA2_BIN" ]; then<br />
echo "aria2c was not found or isn't executable."<br />
exit 1<br />
fi<br />
<br />
filename=$(basename ${1})<br />
server=${1%/${filename}}<br />
<br />
# Determine which official repo is being used<br />
if [ -n "$(grep "^Server = ${server}$" /etc/pacman.d/*)" ]; then<br />
repo=$(grep -l "^Server = ${server}$" /etc/pacman.d/* | head -n 1)<br />
else<br />
repo="custom"<br />
fi<br />
<br />
# Override number of connections for db files<br />
if [[ ${filename} = *.db.tar.gz ]]; then<br />
CONNECTIONS=1<br />
fi<br />
<br />
# For db files, or when using a custom repo (which most likely doesn't have any mirror),<br />
# use only the URL passed by pacman; Otherwise, extract the list of servers (from the include file of the repo) to download from<br />
if [[ ${filename} = *.db.tar.gz || "${repo}" = "custom" ]]; then<br />
url="${1}"<br />
else<br />
url=$(sed -n 's/^Server = //; s,$,/'"${filename}"', ; /^ftp/p; /^http/p' /etc/pacman.d/${repo} | head -n ${SERVERS})<br />
fi<br />
<br />
# Passive FTP or not?<br />
[ "${FTP_PASV}" = "yes" ] && OPT_FTP_PASV="--ftp-pasv" || OPT_FTP_PASV=""<br />
<br />
msg "Downloading ${filename}"<br />
<br />
${ARIA2_BIN} --log=${LOG} --timeout=${TIMEOUT} --max-tries=${MAX_TRIES} --allow-overwrite=true \<br />
--split=${CONNECTIONS} ${OPT_FTP_PASV} --file-allocation=${FILE_ALLOC} \<br />
--lowest-speed-limit=${MIN_SPEED} --max-download-limit=${MAX_SPEED} \<br />
${url} --out=${filename}.pacget && [ ! -f ${filename}.pacget.aria2 ] && mv ${filename}.pacget ${2} && chmod 644 ${2}<br />
<br />
exit 0<br />
</pre><br />
<br />
Save this script as /usr/bin/pacget.<br />
chmod 755 /usr/bin/pacget<br />
This makes the script an executable<br />
<br />
In /etc/pacman.conf the following needs to be added:<br />
XferCommand = exec /usr/bin/pacget %u %o<br />
<br />
PS: If you use ftp.archlinux.org as the first server listed in your include files (/etc/pacman.d/*), some problems may occur when the mirrors you are using have not yet synced. To make great use of this script, choose a mirror (that syncs in a timely manner) that is more appropriate for you, then put that on top of the server lists. This is to prevent downloading only from ftp.archlinux.org when the mirrors have not yet synced.<br />
<br />
=== Using other applications ===<br />
<br />
There are other downloading applications that you can use with Pacman. Here they are, and their associated XferCommand settings:<br />
<br />
* <code>snarf</code>: <code>XferCommand = /usr/bin/snarf -N %u</code><br />
* <code>lftp</code>: <code>XferCommand = /usr/bin/lftp -c pget %u</code></div>Georgekhttps://wiki.archlinux.org/index.php?title=Allow_a_program_to_continue_after_logoff&diff=26591Allow a program to continue after logoff2007-07-05T09:05:17Z<p>Georgek: Ctrl+Alt+F1</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
[[Category:Software (English)]]<br />
[[Category:Utilities (English)]]<br />
<br />
==== Introduction ====<br />
Have you ever had the need to leave a program running after you have logged off? <br />
<br />
This HOWTO will show you how to easily achieve this goal. The things you need to do differ depending on if you are trying to keep a console application running (e.g. mutt, centerICQ) or a X application running (e.g. gaim, graveman). I have created a section for each scenario.<br />
<br />
==== Console applications ====<br />
The program that allows you to detach a console application is '''screen''',<br />
to install it just use pacman:<br />
<br />
<pre><br />
$ pacman -S screen</pre><br />
<br />
'''screen''' has many other functionalities; we will use only showcase the one we need. Read '''man screen''' for more details.<br />
<br />
You should modify '''/etc/screenrc''', the global settings file, to add the two settings. Use your favorite editor to edit <code>/etc/screenrc</code> and add these two lines in the bottom:<br />
<br />
<pre><br />
vbell off<br />
startup_message off</pre><br />
<br />
This allows '''screen''' to start without delays and it won't make an ugly screen flash instead of a bell sound.<br />
<br />
When starting '''screen''' it will not be immediately apparent that you have done anything. In fact, you are actually working inside a new shell. Once you start a program in the shell, you can allow it to continue working, even if you log out. When you want to close the terminal press '''CTRL+a d''' to detach the shell. The console will return in the state it was before calling screen, you can close it safely and the program will continue running in the background.<br />
<br />
To restore your program just start screen with the -r(restore) option: '''screen -r'''. You will be in the exact place where you left it. Even if you closed the window or logged off!<br />
<br />
==== X applications ====<br />
To detach an X application you need '''xmove'''. Like '''screen''', '''xmove''' has some similiar capabilities. Read the manpage for more info.<br />
<br />
Install it with '''pacman''':<br />
<br />
<pre><br />
$ pacman -S xmove</pre><br />
<br />
'''xmove''' is a pseudo server X. It is ''pseudo'' since it does not actually do the work of a server, but instead it speaks with an existing X server.<br />
<br />
In order to use '''xmove''' your X server must accept connections from localhost. Be sure to execute this after you start the X server to allow all local connections:<br />
<br />
<pre><br />
$ xhost +localhost +local:<br />
</pre><br />
<br />
Activate a text shell by pressing '''CTRL+ALT+F1''', log in and start '''xmove''' with<br />
<br />
<pre><br />
$ /usr/bin/xmove -server :0 -port 9 &</pre><br />
<br />
You can log off just afterwards, but you still need to start '''xmove''' in a text terminal to avoid that when closing X (for any reason) '''xmove''' also closes; killing all application you wanted to detach.<br />
<br />
Now, '''xmove''' is working as X server in port <code>:9</code> speaking with the X server in port <code>:0</code>. Zero is usually the port of the first X server, however if you know your X server is somewhere else change the line accordingly.<br />
<br />
Let me explain with a little example: we want to start '''ktorrent'''' and let it continue seeding after log off.<br />
<br />
<pre><br />
$ export DISPLAY=:9<br />
$ nohup ktorrent &<br />
$ exit</pre><br />
<br />
of if you like it compact<br />
<pre><br />
$ env DISPLAY=:9 nohup ktorrent & exit</pre><br />
<br />
'''ktorrent''' will start, lets start the downloading of the .torrent we need. After a while we want log off without interrupting '''ktorrent''''s work. Lets start an other terminal:<br />
<br />
<pre><br />
$ export DISPLAY=:9<br />
$ xmovectrl -list<br />
4 ktorrent :0<br />
$ xmovectrl -move -suspend 4</pre><br />
<br />
'''xmovectrl''' controls the '''xmove''' server, the command <code>-list</code> gives a list of the attached applications. The first column gives an id of the window. The same id used the by <code>-mode</code> command.<br />
<br />
The command <code>-move</code> moves the window from a X server to an other. Putting <code>-suspend</code> will make the window appear nowhere while letting the program continue working.<br />
<br />
<code>nohup</code> may be unnecessary; many X applications ignore the hang up signal by default. To test an application start it from a terminal putting '''&''' at the end of the line, close the terminal. If the X application continues '''nohup''' is not necessary.<br />
<br />
To restore the window and work with the application again you need to start a terminal, set the <code>DISPLAY</code> variable and move the window back to <code>:0</code>. In our example:<br />
<br />
<pre><br />
$ export DISPLAY=:9<br />
$ xmovectrl -list<br />
4 ktorrent suspended<br />
$ xmovectrl -move :0 4</pre><br />
<br />
The '''ktorrent''' window will be restored even after log off.<br />
<br />
If you use '''xmove''' often you may like the idea of making an alias of '''xmovectrl''' so you do not need to set <code>DISPLAY</code> every time. To do that add to your <code>~/.bashrc</code> (or other shell initializing file):<br />
<br />
<pre><br />
alias xmovectrl='env DISPLAY=:9 xmovectrl'</pre><br />
<br />
This alias will set <code>DISPLAY</code> for you every time you call '''xmovectrl'''.<br />
<br />
'''xmove''' X server has less capabilities than the usual server. Some applications will not work well, or not work at all. Make some tests before using it with vital applications!<br />
<br />
==== Conclusion ====<br />
<br />
Detaching programs is very useful in shared systems, you can easily leave the machine to someone else while your programs continue to run. At the moment, however, it is still easier to do this with console applications. Since in the Linux world almost every task has its console the only application it is a good idea use it with '''screen'''. In the above example using '''transmission''' and '''screen''' is actually easier than '''ktorrent''' and '''xmove'''.</div>Georgekhttps://wiki.archlinux.org/index.php?title=Localization_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=25270Localization (Русский)2007-06-04T11:55:32Z<p>Georgek: Consistency</p>
<hr />
<div>[[Category:Internationalisation]]<br />
[[Category:System Configuration]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Deutsch|Internationalisierung}}<br />
{{i18n_entry|Français|Internationalisation (Français)}}<br />
{{i18n_entry|Русский|Интернационализация}}<br />
{{i18n_entry|Slovenčina|Internacionalizácia}}<br />
{{i18n_entry|Svenska|Internationalisering}}<br />
{{i18n_entry|日本語|国際化と地域化}}<br />
{{i18n_entry|繁體中文|Arch 與国際化}}<br />
{{i18n_links_end}}<br />
<br />
= Об этой статье =<br />
Эта статья рассказывает о том, как настроить отображение и ввод русского языка в Arch Linux.<br />
<br />
= Настройка локали =<br />
<br />
В файле /etc/locale.gen раскомментируйте следующую строку:<br />
<br />
<pre><br />
ru_RU.UTF-8 UTF-8<br />
</pre><br />
<br />
<br />
Создайте выбранную вами локаль командой:<br />
<pre><br />
locale-gen<br />
</pre><br />
<br />
<br />
Проверьте, что все заявленные локали были созданы:<br />
<pre><br />
locale -a<br />
</pre><br />
<br />
= Настройка консоли = <br />
<br />
Установите пакет kbd-ru-keymaps командой<br />
<br />
<pre>pacman -S kbd-ru-keymaps</pre><br />
<br />
или cкачайте одну из раскладкок вручную:<br />
<br />
*[http://mlclm.narod.ru/ru-utf.map.gz Русская UTF-8 раскладка клавиатуры с переключением по правой клавише Alt]<br />
*[http://moose.ylsoftware.com/gentoo.ru/ru-mab.map.gz Русская UTF-8 раскладка клавиатуры с переключением по Ctrl-Shift]<br />
<br />
и поместите в каталог '''/usr/share/kbd/keymaps/i386/qwerty'''<br />
<br />
<br />
Установите шрифт Terminus из репозитория '''community''':<br />
<pre> pacman -S terminus-font</pre><br />
<br />
<br />
Отредактируйте файл /etc/rc.conf :<br />
<br />
<pre>LOCALE="ru_RU.UTF-8"<br />
KEYMAP="ru-utf" # Или ru-mab для раскладки с переключением по Ctrl-Shift<br />
CONSOLEFONT=ter-u16b # Можно поэкспериментировать с другими шрифтами ter-u* из /usr/share/kbd/consolefonts<br />
CONSOLEMAP="/usr/share/kbd/consoletrans/cp866_to_uni"<br />
</pre><br />
<br />
Можно обойтись и без terminus, установив:<br />
CONSOLEFONT=/usr/share/kbd/consolefonts/cyr-sun16<br />
<br />
= Настройка X.org =<br />
Установите шрифты ttf-dejavu и ttf-ms-fonts из репозитория '''community''':<br />
<pre>pacman -S ttf-ms-fonts ttf-dejavu</pre><br />
<br />
Отредактируйте /etc/X11/xorg.conf:<br />
<br />
<pre><br />
Option "XkbLayout" "us,ru"<br />
Option "XkbVariant" ",winkeys"<br />
Option "XkbOptions" "grp:ctrl_shift_toggle,grp_led:scroll"</pre><br />
Раскладки переключаются комбинацией Ctrl-Shift, при использовании русской раскладки горит лампочка Scroll Lock.<br />
<br />
Возможно будет удобно использовать <Menu> для переключения раскладок и поменять CapsLock и левый Ctrl. Тогда нужно написать так:<br />
<br />
<pre>Option "XKbOptions" "grp:menu_toggle,grp_led:scroll,ctrl:swapcaps"</pre><br />
<br />
= Настройка GTK1 =<br />
Отредактируйте файл /etc/gtk/gtkrc.ru :<br />
<pre>style "gtk-default-ru" {<br />
fontset = "-*-arial-medium-r-normal--12-*-*-*-*-*-iso10646-1",\<br />
-*-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-1"<br />
}<br />
class "GtkWidget" style "gtk-default-ru"</pre><br />
<br />
= Настройка ncurses приложений =<br />
== Midnight Commander (mc) ==<br />
Надо установить пакет mc-utf8, который находятся в репозитории '''community''':<br />
pacman -Sy mc-utf8<br />
Теперь mc собран с поддержкой юникодной локали и имеет приличный вид.<br />
<br />
== nano ==<br />
С версии 2.0 nano поддерживает utf-8.<br />
<br />
= Настройка русских man-страниц =<br />
<br />
Установите русские страницы командой<br />
pacman -Sy man-pages-ru<br />
<br />
Отредактируйте /usr/share/misc/man.conf добавив вызов iconv<br />
NROFF iconv -f utf8 -t koi8r | /usr/bin/nroff -Tlatin1 -mandoc -c | iconv -f koi8r -t utf8<br />
<br />
Еше один вариант (с автоматическим определением кодировки man-страниц с использованием пакета enca):<br />
NROFF /usr/bin/enconv -L ru -x KOI8-R | /usr/bin/nroff -Tlatin1 -mandoc -c | /usr/bin/enconv -L ru -x UTF-8<br />
<br />
(К сожалению в данный момент nroff не умеет обрабатывать UTF-8 тексты, поэтому приходится перекодировать их в KOI8-R и обратно)<br />
<br />
Также позаботьтесь о том, чтобы переменная окружения LESSCHARSET имела значение UTF-8.<br />
<br />
= Настройка fluxbox =<br />
Для отображения русского языка в окнах и меню стоит установить подходящий шрифт в выбранной вами теме. Например (если установлен пакет ttf-dejavu):<br />
*Font: -*-dejavu sans-*<br />
Теперь fluxbox поддерживает русские названия, даже если вы используете локаль en_US.UTF-8.<br />
<br />
[[Category:Русский]]</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=25001User:Georgek2007-05-29T13:34:12Z<p>Georgek: </p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== My playground ==<br />
<br />
=== Aspell - spell checking for multiple languages ===<br />
<br />
Aspell guesses the default dictionary by your environment variables. For example if LANG="ru_RU.UTF-8" (and you have installed "aspell-ru") then default dictionary will be "ru".<br />
<br />
cd /usr/share/aspell<br />
grep ^special en.dat >>ru.dat<br />
cd /usr/lib/aspell<br />
aspell dump master en >w.en<br />
aspell dump master ru-yo >w.ru<br />
cat w.ru w.en >w.all<br />
aspell --lang=ru create master multi.rws < w.all<br />
rm -f w.ru w.en w.all<br />
echo "add multi.rws" > multi.multi</div>Georgekhttps://wiki.archlinux.org/index.php?title=User:Georgek&diff=25000User:Georgek2007-05-29T13:25:06Z<p>Georgek: New page: Georgij Kondratjev == My playground ==</p>
<hr />
<div>Georgij Kondratjev<br />
<br />
== My playground ==</div>Georgekhttps://wiki.archlinux.org/index.php?title=64-bit_FAQ&diff=2433564-bit FAQ2007-05-17T16:56:41Z<p>Georgek: xhost +local:. "local:" family exists spesially for this purpouse</p>
<hr />
<div>[[Category:Arch64 (English)]]<br />
[[Category:FAQs (English)]]<br />
<br />
Below is a list of frequently asked questions about Arch64.<br />
<br />
==How can I install Arch64?==<br />
Just use our [http://www.archlinux.org/download/ official install iso cd].<br />
<br />
==How complete is the port? Will I have all the packages from my Arch32 Env?==<br />
<br />
Current+Extra repos are ported and almost everything is up to date, only hours or a few days at most behind ArchLinux i686. Our TU's are trying to port the Community repo now.<br />
<br />
The port is ready for daily use in a desktop or server environment.<br />
<br />
==Does 64-bit mean a great speed improvement?==<br />
For applications using the 64-bit cpu registers (large databases and such) this is true in most cases. Some multimedia applications will also run noticeably faster. If you know an application which is known to be much faster when using SSE3 extensions you can rebuild the package yourself. We ''only'' compile with SSE2 support(from march=x86_64) and -O2 optimizations.<br />
For more read http://forums.gentoo.org/viewtopic.php?t=221045 or http://www.thejemreport.com/mambo/content/view/74/74/ .<br />
<br />
For the rest of the system: It doesn't make any difference if the keyboard waits. <br />
<br />
For further details watch our [[Arch64_ToDoS]]. There you will find a list comparing arch32/arch64 package versions.<br />
<br />
For certain boot problems try these special kernel boot flags<br />
http://www.x86-64.org/lists/discuss/msg03747.html<br />
<br />
==Attention when you update glibc from <2.4version!==<br />
It's important if you update glibc from a version <2.4 that you do it in a seperate step. So do only pacman -Sy glibc and if it was successful do pacman -Su. Otherwise the lib-moving may fail and you will have to use pacman.static to fix it.<br />
<br />
==How can I file bugs?==<br />
Simply use Arch's flyspray but note x86_64 in the topic if you think it's a port related problem!<br />
<br />
== Do you have a mailing list?==<br />
Yes there is a generic [http://archlinux.org/mailman/listinfo/arch-ports mailing list about archports].<br />
<br />
==What repos should I setup for pacman to use?==<br />
All repos are supported for the port.<br />
<br />
==How can I get the Arch64 PKGBUILDs?==<br />
We have '''''ABS''''' as arch 32bit. Recommended place to store is in ''/var/abs''. ''abs'' fetches all cvs entries from archlinux.org tagged with CURRENT-64.<br />
<br />
==How can I build new Arch64 packages using existing 32-bit PKGBUILDs?==<br />
We have common PKGBUILDs with arch32. You can get not yet ported 32bit pkgbuilds from cvs: http://www.archlinux.org/cvs/<br />
<br />
==How can I patch existing pkgbuilds for use with Arch64?==<br />
We add to all ported packages this variable:<br />
arch=(i686 x86_64) <br />
Add small patches directly to the sources and md5sums area but use for complete different sources:<br />
[ "$CARCH" = "x86_64" ] && source=(${source[@]} 'other source')<br />
[ "$CARCH" = "x86_64" ] && md5sums=(${md5sums[@]} 'other md5sum')<br />
For any small fix use this in the build area:<br />
[ "$CARCH" = "x86_64" ] && (patch -Np0 -i ../foo_x86_64.patch || return 1)<br />
Or when you need more changes:<br />
if [ "$CARCH" = "x86_64" ]; then<br />
configure/patch/sed # for x86_64<br />
else configure/patch/sed # for i686<br />
fi<br />
For the devs:<br />
cvs commit -m "x86_64 updated/fixed or whatever"<br />
cvs tag -cFR CURRENT-64 foo-package-directory (even for extra, community, unstable and testing)<br />
<br />
==What will I miss in Arch64?==<br />
The following applications are known not to be 64-bit compatible:<br />
<br />
* no Java plugin shipped by Sun; KDE's Konqueror has its own native running 64bit JavaPlugin built in! Best solution to browse JavaApplets these days.<br />
* true x86_64 Flash support only in parts with GPL gnash package from extra repo<br />
* no native Flash plugin shipped by Macromedia/Adobe - nspluginwrapper package from community allows to use 32bit plugins but forces to install lib32 packages - follow this guide on how to [[Install Flash on Arch64]]<br />
* Closed source apps like skype, opera - where they don't provide 100% statically built binaries so 32-bit libs are still needed<br />
* additional win32 codecs (...that nobody really needs)<br />
* packages that use x86 32bit assembler code (some emulators like zsnes ans syslinux)<br />
<br />
<br />
Almost everything else should be portable. If you miss any arch32 package in our port and you know that it will compile on x86_64 (e.g. you have found it in another 64-bit distribution without using multilibs) just contact the devs.<br />
<br />
==Can I run 32-bit apps inside Arch64?==<br />
Yes! <br />
<br />
'''BUT: Our goal is to be the most bleeding edge distribution around! 32-bit is old fashioned. We want Arch64 to be modern and pure 64-bit. So we don't have a Multilib system. We won't take any package into the repos improving 32-bit compatibility. Maybe we will place them into the AUR or community repo.'''<br />
'''''Don't expect any support from the devs getting 32-bit apps running on Arch64!'''''<br />
<br />
Boot into Arch64, startx, open a term.<br />
xhost +local:<br />
su<br />
mount /dev/sda1 /mnt/arch32<br />
mount --bind /proc /mnt/arch32/proc<br />
chroot /mnt/arch32<br />
su your32bitusername<br />
/usr/bin/command-you want # or eg: /opt/mozilla/bin/firefox<br />
<br />
Some 32-bit apps (like openoffice) may require additional bindings. The following lines can be placed in rc.local to ensure you get all you need for the 32-bit apps (assuming /mnt/arch32 is mounted in fstab):<br />
mount --bind /dev /mnt/arch32/dev<br />
mount --bind /dev/pts /mnt/arch32/dev/pts<br />
mount --bind /dev/shm /mnt/arch32/dev/shm<br />
mount --bind /proc /mnt/arch32/proc<br />
mount --bind /proc/bus/usb /mnt/arch32/proc/bus/usb<br />
mount --bind /sys /mnt/arch32/sys<br />
mount --bind /tmp /mnt/arch32/tmp<br />
#comment the following line if you do not use the same home folder<br />
mount --bind /home /mnt/arch32/home<br />
You can then type in a term:<br />
xhost +localhost<br />
sudo chroot /mnt/arch32 su your32bitusername /opt/openoffice/program/soffice</div>Georgekhttps://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=23449VCS package guidelines2007-04-24T16:52:39Z<p>Georgek: Fix darcs PKGBUILD not to lead writers to the same mistakes</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:Development (English)]]<br />
[[Category:Package development (English)]]<br />
[[Category:Tutorials (English)]]<br />
<br />
:''This is actually very easy and doesn't require any special knowledge. However, the more you know about cvs and svn the easier it is. Many people introduce custom variables into the PKGBUILD that can over complicate things. These are not ''really'' necessary but do help to clarify the syntax of the cvs/svn/git commands, which can appear quite complex.''<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Arch CVS %26 SVN PKGBUILD guidelines}}<br />
{{i18n_entry|繁體中文|Arch CVS %26 SVN PKGBUILD 編寫指南}}<br />
{{i18n_entry|简体中文|Arch CVS %26 SVN %26 GIT PKGBUILD 编写指南}}<br />
{{i18n_links_end}}<br />
<br />
<br />
==A few tips==<br />
<br />
* Suffix <code>pkgname</code> with <code>-cvs</code> or <code>-svn</code> or <code>-git</code> where applicable - this prevents confusion with non-development versions e.g. fluxbox-svn or fvwm-cvs vs fluxbox and fvwm.<br />
* You must also be careful about pacman conflicts. For example fluxbox-svn will conflict with fluxbox. In this case you need to use the <tt>conflicts=</tt> field<br />
conflicts=('fluxbox')<br />
: You should also use the <tt>provides=</tt> field so that pkgs that require fluxbox to be installed recognize your fluxbox-svn pkg as fluxbox<br />
provides=('fluxbox')<br />
: You should AVOID using <tt>replaces=</tt> it generally causes unnecessary problems<br />
*When using/defining the cvsroot use anonymous<b>:</b>@ rather than anonymous@ to avoid having to press enter to give blank password ''OR'' anonymous<b>:password</b>@ - if a password is required.<br />
* cvs and svn PKGBUILDs may not require a source or md5sum array but these fields '''must''' be included in the PKGBUILD if you wish to submit it to the AUR, otherwise the pkg will be rejected. They may be left blank though.<br />
<pre>source=()<br />
md5sums=()</pre><br />
* It is rarely necessary to use the pkgrel field when building CVS/SVN/GIT pkgs - any changes to the pkg will often be on another day and so are usually accounted for by a change in pkgver (assuming pkgver is used to hold a date format)<br />
* don't forget to include cvs or subversion in <code>makedepends=</code> as necessary<br />
* to preserve the integrity of the checked out code it is usually possible to build in a separate build dir e.g. having checked out source code to src/$_cvsmod from $startdir you can use:<br />
<pre> mkdir src/$_cvsmod-build<br />
<br />
cd src/$_cvsmod-build<br />
../$_cvsmod/configure</pre><br />
''OR'' if that fails you can try:<br />
<pre> cp -r src/$_cvsmod src/$_cvsmod-build<br />
cd src/$_cvsmod-build</pre><br />
<br />
* With the introduction of the AUR it is most important to avoid using backtick execution to create pkg variables<br />
** For cvs pkgs you should avoid <code>pkgver=`date +%y%m%d`</code> - this also interferes with the functionality of the AUR. Instead it is still possible to use a date format for the $pkgver variable and to use the cvs -D option to check out code from that date (see below)<br />
** For svn you can use the revision number. An easy way to find the revision number is to use the following command:<br />
svn log $_svntrunk --limit 1 | grep -m 1 -o "r.*" | cut -d \| -f 1 | sed s@r@@g<br />
That command grabs the most recent log entry from the svn repo and finds the revision number, which is prefixed with an r. This is from the fluxbox svn log, the revision number is in the top left, r4084<br />
<pre><br />
------------------------------------------------------------------------<br />
r4084 | mathias | 2005-07-20 19:29:01 +0100 (Wed, 20 Jul 2005) | 16 lines<br />
<br />
Changed some *Focus options, just to make some things a bit more clear.<br />
the "Sloppy" was always a bit .. imprecise.<br />
</pre><br />
<br />
==Example CVS PKGBUILD==<br />
<br />
Here is a PKGBUILD for bmp-cvs that utilizes some of the tips above<br />
<br />
<pre># Contributor: Lukas Sabota <punkrockguy318@comcast.net><br />
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org<br />
arch=(i686 x86_64)<br />
pkgname=bmp-cvs<br />
pkgver=20050728<br />
pkgrel=1<br />
pkgdesc="BeepMP is a multimedia player that uses the WinAmp 2.x UI, GTK2, and is based on XMMS. This will checkout and package the latest CVS version."<br />
url="http://beepmp.sourceforge.net/"<br />
license=<br />
depends=('gtk2' 'libvorbis' 'alsa-lib' 'audiofile' 'libglade' 'id3lib' 'x-server')<br />
provides=('bmp')<br />
conflicts=('bmp')<br />
makedepends=('cvs')<br />
install=$pkgname.install<br />
<br />
_cvsroot=":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/beepmp"<br />
_cvsmod="bmp"<br />
<br />
build() {<br />
cd $startdir/src<br />
msg "Connecting to $_cvsmod.sourceforge.net CVS server...."<br />
if [ -d $_cvsmod/CVS ]; then<br />
cd $_cvsmod<br />
cvs -z3 update -d<br />
else<br />
cvs -z3 -d $_cvsroot co -D $pkgver -f $_cvsmod<br />
cd $_cvsmod<br />
fi<br />
./autogen.sh<br />
<br />
msg "CVS checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r ../$_cvsmod ../$_cvsmod-build<br />
cd ../$_cvsmod-build<br />
<br />
./configure --prefix=/usr<br />
make || return 1<br />
make DESTDIR=$startdir/pkg install || return 1<br />
<br />
mkdir -p $startdir/pkg/usr/share/xmms/Skins<br />
mv $startdir/pkg/usr/share/bmp/Skins/* $startdir/pkg/usr/share/xmms/Skins<br />
rmdir $startdir/pkg/usr/share/bmp/Skins<br />
<br />
rm -r $startdir/src/$_cvsmod-build<br />
}<br />
# vim:syntax=sh<br />
</pre><br />
<br />
==Example SVN PKGBUILD==<br />
<br />
If you use the <tt>source</tt> command on the PKGBUILD first it will store the _svntrunk and _svnmod variables. So if you run :<br />
source PKGBUILD<br />
svn info $_svntrunk<br />
you can get the revision number(Or,Last Changed Rev) which can be used in pkgver<br />
<br />
<pre><br />
# Contributor: Lukas Sabota <punkrockguy318@comcast.net><br />
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org<br />
arch=(i686 x86_64)<br />
pkgname=fluxbox-svn<br />
pkgver=4084<br />
pkgrel=1<br />
pkgdesc="Fluxbox-svn is the bleeding edge version of a lightweight yet \<br />
customizable windowmanager for X. This will checkout and package the latest SVN version."<br />
url="http://www.fluxbox.org"<br />
license=<br />
<br />
depends=('bash' 'x-server')<br />
makedepends=('subversion')<br />
conflicts=('blackbox' 'fluxbox' 'fluxbox-devel' 'fluxbox-cvs')<br />
provides=('fluxbox')<br />
<br />
source=()<br />
md5sums=()<br />
<br />
_svntrunk=svn://svn.berlios.de/fluxbox/trunk<br />
_svnmod=fluxbox<br />
<br />
build() {<br />
cd $startdir/src<br />
<br />
if [ -d $_svnmod/.svn ]; then<br />
(cd $_svnmod && svn up -r $pkgver)<br />
else<br />
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod<br />
fi<br />
<br />
msg "SVN checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r $_svnmod $_svnmod-build<br />
cd $_svnmod-build<br />
<br />
./autogen.sh<br />
<br />
# fix for crap fb issue<br />
mkdir data<br />
cp ../$_svnmod/data/keys data/<br />
<br />
./configure --prefix=/usr --enable-xinerama --enable-imlib2 --enable-debug<br />
make || return 1<br />
make DESTDIR=$startdir/pkg/ install<br />
<br />
rm -rf $startdir/src/$_svnmod-build<br />
}<br />
# vim:syntax=sh</pre><br />
<br />
==Example GIT PKGBUILD==<br />
<br />
<pre><br />
arch=(i686 x86_64)<br />
pkgname=compiz-git<br />
pkgver=20060707<br />
pkgrel=1<br />
pkgdesc="Composite and window manager for Xgl"<br />
url="http://en.opensuse.org/Compiz"<br />
license=""<br />
depends=('xgl-cvs' 'mesa-xgl-cvs' 'cairo-devel' 'libxevie' \<br />
'startup-notification' 'libpng' 'libxdamage' \<br />
'libxrandr' 'libwnck-compiz' 'gnome-desktop' 'control-center' \<br />
'libsvg-cairo' 'libxcomposite')<br />
makedepends=('git')<br />
conflicts=()<br />
replaces=()<br />
backup=()<br />
install=compiz.install<br />
source=(compiz-intel-copy-pixel-issue-workaround-1.diff)<br />
md5sums=('10a157b86d528bca2be6731c5eaff7b3')<br />
<br />
_gitroot="git://anongit.freedesktop.org/git/xorg/app/compiz"<br />
_gitname="compiz"<br />
build() {<br />
export CFLAGS="$CFLAGS -I/opt/mesa-xgl-cvs/include"<br />
cd $startdir/src<br />
msg "Connecting to git.freedesktop.org GIT server...."<br />
<br />
if [ -d $startdir/src/$_gitname ] ; then<br />
cd $_gitname && git-pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone $_gitroot<br />
fi<br />
<br />
msg "GIT checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r $startdir/src/$_gitname $startdir/src/$_gitname-build<br />
cd $startdir/src/$_gitname-build<br />
patch -Np0 -i ${startdir}/src/compiz-intel-copy-pixel-issue-workaround-1.diff<br />
<br />
ACLOCAL="aclocal -I /opt/gnome/share/aclocal" ./autogen.sh --host=${CHOST} \<br />
--prefix=/usr \<br />
--infodir=/usr/share/info \<br />
--mandir=/usr/man \<br />
--sysconfdir=/opt/gnome/etc \<br />
--enable-gnome \<br />
--enable-libsvg-cairo \<br />
--enable-gconf-dump \<br />
--disable-kde || return 1<br />
make || return 1<br />
make DESTDIR=$startdir/pkg install<br />
<br />
find $startdir/pkg -type f -name '*.la' -exec rm {} \;<br />
} <br />
</pre><br />
As you see, I use "-git" suffix in the pkgname, and two variables, _gitroot and _gitname for identify the repositories and the name of the package.<br />
I need to introduce an if condition: <br />
<pre><br />
if [ -d $startdir/src/$_gitname ] ; then<br />
cd $_gitname && git-pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone $_gitroot<br />
fi<br />
</pre><br />
because we have two commands, one for updating source and one for getting it. I copy the source code in a "-build" directory ( the same thing that we do with -cvs and -svn program ).<br />
<br />
==Example darcs PKGBUILD==<br />
<pre><br />
pkgname=psi-darcs<br />
pkgver=20070404<br />
pkgrel=2<br />
pkgdesc="Psi - Jabber client (with SSL support) darcs version"<br />
makedepends=('darcs' 'qt4>=4.2')<br />
depends=('qt4>=4.2' 'openssl' 'libxss' 'cyrus-sasl' 'aspell') <br />
source=()<br />
conflicts=('psi')<br />
provides=('psi')<br />
url="http://psi-im.org/"<br />
md5sums=()<br />
<br />
_darcsmod="psi"<br />
_darcstrunk="http://dev.psi-im.org/darcs"<br />
<br />
build() {<br />
cd $startdir/src/<br />
# Erasing previous build<br />
msg "Checking for previous build"<br />
# get the sources<br />
if [[ -d psi/_darcs ]]<br />
then<br />
msg "Retrieving missing patches"<br />
cd $_darcsmod<br />
darcs pull -a $_darcstrunk/$_darcsmod<br />
else<br />
msg "Retrieving complete sources"<br />
darcs get --partial --set-scripts-executable $_darcstrunk/$_darcsmod<br />
cd $_darcsmod<br />
fi<br />
<br />
. /etc/profile.d/qt4.sh<br />
export PATH=$QTDIR/bin:$PATH<br />
<br />
# building<br />
msg "Starting build"<br />
./configure --prefix=/usr --disable-xmms<br />
make || return 1<br />
make INSTALL_ROOT=$startdir/pkg install<br />
}<br />
</pre><br />
<br />
==versionpkg - a <tt>makepkg</tt> wrapper for CVS/SVN builds==<br />
This is a very simple script that allows you to easily update your CVS and SVN packages without having to edit the PKGBUILDs manually to enter the date or revision number.<br />
<br />
Simply run this script rather than <tt>makepkg</tt> in the build dir. This script completely removes the need for backtick execution to set the date or tag version in PKGBUILDs.<br />
<br />
To use the script;<br />
* Ensure that pkgver is declared within the first ten lines of the PKGBUILD or it won't work!<br />
* Ensure you have included the following custom variables and checkout command:<br />
* CVS<br />
_cvsroot=<br />
: The root of the CVS server - remember to include a colon (:) after the username as outlined above<br />
_cvsmod=<br />
: Simply the CVS module name you wish to check out e.g.<br />
_cvsroot=":pserver:anonymous:@mplayerhq.hu:/cvsroot/ffmpeg"<br />
_cvsmod="ffmpeg"<br />
: Here is the checkout command for CVS that uses the above variables. The <strong>-D</strong> option is essential for proper use of <code>versionpkg</code> and is best used in combination with the <strong>-f</strong> option. Use of <strong>-D</strong> without <strong>-f</strong> may result in errors<br />
cvs -z9 -q -d $_cvsroot co -D $pkgver -f $_cvsmod<br />
: -z controls the level of compression (1 is low 9 is high)<br />
: -D specifies the date to check out, we use $pkgver as that is set to the current date by the script.<br />
: -q is a quiet switch<br />
* SVN<br />
_svntrunk=<br />
: The address of the SVN trunk<br />
_svnmod=<br />
: Again the module you wish to check out from trun e.g.<br />
_svntrunk=svn://svn.berlios.de/fluxbox/trunk<br />
_svnmod=fluxbox<br />
: Here is the checkout command for SVN that uses the above variables. The <strong>-r</strong> option is essential for proper use of <code>versionpkg</code>.<br />
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod<br />
: Here -r specifies the revision number, we use $pkgver as that is set to the latest revision number by the script.<br />
<br />
===The script!===<br />
To improve security, versionpkg can now be installed directly from [community] <code>pacman -S versionpkg</code>. I strongly recommend that you use that. The script below is purely for illustrative purposes :)<br><br />
Changelog:<br />
* check for both CVS/SVN vars<br />
* If build fails revert to previous pkgver to allow correct gensync operation<br />
* Added support for coloured messages<br />
<pre>#!/bin/bash<br />
<br />
# versionpkg - a makepkg wrapper for building CVS/SVN pkgs<br />
# dibblethewrecker.at.jiwe.org<br />
<br />
# makepkg configuration<br />
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf<br />
<br />
# SUBROUTINES<br />
plain() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e " \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo " $1" >&2<br />
fi<br />
}<br />
msg() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;32m==>\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> $1" >&2<br />
fi<br />
}<br />
warning() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;33m==> WARNING:\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> WARNING: $1" >&2<br />
fi<br />
}<br />
error() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;31m==> ERROR:\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> ERROR: $1" >&2<br />
fi<br />
return 1<br />
}<br />
<br />
source ./PKGBUILD<br />
oldpkgver=$pkgver<br />
<br />
if [ ! -z ${_cvsroot} ] && [ ! -z ${_cvsmod} ] ; then<br />
cvsdate=`date +%Y%m%d`<br />
sed -i "1,11 s|pkgver=$oldpkgver|pkgver=$cvsdate|" ./PKGBUILD<br />
makepkg $@<br />
if [ $? -gt 0 ] ; then<br />
error "Reverting pkgver..."<br />
sed -i "1,11 s|pkgver=$cvsdate|pkgver=$oldpkgver|" ./PKGBUILD<br />
fi <br />
elif [ ! -z ${_svntrunk} ] && [ ! -z ${_svnmod} ] ; then<br />
svnrevno=`svn log $_svntrunk --limit 1 | grep -m 1 -o "r.*" | cut -d \| -f 1 | sed s@r@@g`<br />
msg "Current revision number is $svnrevno"<br />
if [ "${1}" != "-f" ] && [ "${oldpkgver}" == "${svnrevno}" ] ; then<br />
error "No new revision available. (use -f to overwrite)"<br />
exit<br />
fi<br />
sleep 3<br />
sed -i "1,11 s|pkgver=$oldpkgver|pkgver=$svnrevno|" ./PKGBUILD<br />
makepkg $@<br />
if [ $? -gt 0 ] ; then<br />
error "Reverting pkgver..."<br />
sed -i "1,11 s|pkgver=$svnrevno|pkgver=$oldpkgver|" ./PKGBUILD<br />
fi <br />
else<br />
error "No SVN or CVS variables found! Aborting..."<br />
exit<br />
fi<br />
</pre></div>Georgekhttps://wiki.archlinux.org/index.php?title=Talk:VCS_package_guidelines&diff=23386Talk:VCS package guidelines2007-04-22T13:50:46Z<p>Georgek: </p>
<hr />
<div>Q: Any reason for using 'svn co' instead of 'svn export'? export is way faster for these situations and it doesn't create all the .svn files.<br />
<br />
A: Look at http://bbs.archlinux.org/viewtopic.php?pid=245213</div>Georgekhttps://wiki.archlinux.org/index.php?title=Talk:VCS_package_guidelines&diff=23385Talk:VCS package guidelines2007-04-22T13:50:24Z<p>Georgek: </p>
<hr />
<div>Q: Any reason for using 'svn co' instead of 'svn export'? export is way faster for these situations and it doesn't create all the .svn files.<br />
A: Look at http://bbs.archlinux.org/viewtopic.php?pid=245213</div>Georgekhttps://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=23278VCS package guidelines2007-04-18T17:12:35Z<p>Georgek: 'svn up' fix</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:Development (English)]]<br />
[[Category:Package development (English)]]<br />
[[Category:Tutorials (English)]]<br />
<br />
:''This is actually very easy and doesn't require any special knowledge. However, the more you know about cvs and svn the easier it is. Many people introduce custom variables into the PKGBUILD that can over complicate things. These are not ''really'' necessary but do help to clarify the syntax of the cvs/svn/git commands, which can appear quite complex.''<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Arch CVS %26 SVN PKGBUILD guidelines}}<br />
{{i18n_entry|繁體中文|Arch CVS %26 SVN PKGBUILD 編寫指南}}<br />
{{i18n_entry|简体中文|Arch CVS %26 SVN %26 GIT PKGBUILD 编写指南}}<br />
{{i18n_links_end}}<br />
<br />
<br />
==A few tips==<br />
<br />
* Suffix <code>pkgname</code> with <code>-cvs</code> or <code>-svn</code> or <code>-git</code> where applicable - this prevents confusion with non-development versions e.g. fluxbox-svn or fvwm-cvs vs fluxbox and fvwm.<br />
* You must also be careful about pacman conflicts. For example fluxbox-svn will conflict with fluxbox. In this case you need to use the <tt>conflicts=</tt> field<br />
conflicts=('fluxbox')<br />
: You should also use the <tt>provides=</tt> field so that pkgs that require fluxbox to be installed recognize your fluxbox-svn pkg as fluxbox<br />
provides=('fluxbox')<br />
: You should AVOID using <tt>replaces=</tt> it generally causes unnecessary problems<br />
*When using/defining the cvsroot use anonymous<b>:</b>@ rather than anonymous@ to avoid having to press enter to give blank password ''OR'' anonymous<b>:password</b>@ - if a password is required.<br />
* cvs and svn PKGBUILDs may not require a source or md5sum array but these fields '''must''' be included in the PKGBUILD if you wish to submit it to the AUR, otherwise the pkg will be rejected. They may be left blank though.<br />
<pre>source=()<br />
md5sums=()</pre><br />
* It is rarely necessary to use the pkgrel field when building CVS/SVN/GIT pkgs - any changes to the pkg will often be on another day and so are usually accounted for by a change in pkgver (assuming pkgver is used to hold a date format)<br />
* don't forget to include cvs or subversion in <code>makedepends=</code> as necessary<br />
* to preserve the integrity of the checked out code it is usually possible to build in a separate build dir e.g. having checked out source code to src/$_cvsmod from $startdir you can use:<br />
<pre> mkdir src/$_cvsmod-build<br />
<br />
cd src/$_cvsmod-build<br />
../$_cvsmod/configure</pre><br />
''OR'' if that fails you can try:<br />
<pre> cp -r src/$_cvsmod src/$_cvsmod-build<br />
cd src/$_cvsmod-build</pre><br />
<br />
* With the introduction of the AUR it is most important to avoid using backtick execution to create pkg variables<br />
** For cvs pkgs you should avoid <code>pkgver=`date +%y%m%d`</code> - this also interferes with the functionality of the AUR. Instead it is still possible to use a date format for the $pkgver variable and to use the cvs -D option to check out code from that date (see below)<br />
** For svn you can use the revision number. An easy way to find the revision number is to use the following command:<br />
svn log $_svntrunk --limit 1 | grep -m 1 -o "r.*" | cut -d \| -f 1 | sed s@r@@g<br />
That command grabs the most recent log entry from the svn repo and finds the revision number, which is prefixed with an r. This is from the fluxbox svn log, the revision number is in the top left, r4084<br />
<pre><br />
------------------------------------------------------------------------<br />
r4084 | mathias | 2005-07-20 19:29:01 +0100 (Wed, 20 Jul 2005) | 16 lines<br />
<br />
Changed some *Focus options, just to make some things a bit more clear.<br />
the "Sloppy" was always a bit .. imprecise.<br />
</pre><br />
<br />
==Example CVS PKGBUILD==<br />
<br />
Here is a PKGBUILD for bmp-cvs that utilizes some of the tips above<br />
<br />
<pre># Contributor: Lukas Sabota <punkrockguy318@comcast.net><br />
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org<br />
arch=(i686 x86_64)<br />
pkgname=bmp-cvs<br />
pkgver=20050728<br />
pkgrel=1<br />
pkgdesc="BeepMP is a multimedia player that uses the WinAmp 2.x UI, GTK2, and is based on XMMS. This will checkout and package the latest CVS version."<br />
url="http://beepmp.sourceforge.net/"<br />
license=<br />
depends=('gtk2' 'libvorbis' 'alsa-lib' 'audiofile' 'libglade' 'id3lib' 'x-server')<br />
provides=('bmp')<br />
conflicts=('bmp')<br />
makedepends=('cvs')<br />
install=$pkgname.install<br />
<br />
_cvsroot=":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/beepmp"<br />
_cvsmod="bmp"<br />
<br />
build() {<br />
cd $startdir/src<br />
msg "Connecting to $_cvsmod.sourceforge.net CVS server...."<br />
if [ -d $_cvsmod/CVS ]; then<br />
cd $_cvsmod<br />
cvs -z3 update -d<br />
else<br />
cvs -z3 -d $_cvsroot co -D $pkgver -f $_cvsmod<br />
cd $_cvsmod<br />
fi<br />
./autogen.sh<br />
<br />
msg "CVS checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r ../$_cvsmod ../$_cvsmod-build<br />
cd ../$_cvsmod-build<br />
<br />
./configure --prefix=/usr<br />
make || return 1<br />
make DESTDIR=$startdir/pkg install || return 1<br />
<br />
mkdir -p $startdir/pkg/usr/share/xmms/Skins<br />
mv $startdir/pkg/usr/share/bmp/Skins/* $startdir/pkg/usr/share/xmms/Skins<br />
rmdir $startdir/pkg/usr/share/bmp/Skins<br />
<br />
rm -r $startdir/src/$_cvsmod-build<br />
}<br />
# vim:syntax=sh<br />
</pre><br />
<br />
==Example SVN PKGBUILD==<br />
<br />
If you use the <tt>source</tt> command on the PKGBUILD first it will store the _svntrunk and _svnmod variables. So if you run :<br />
source PKGBUILD<br />
svn info $_svntrunk<br />
you can get the revision number(Or,Last Changed Rev) which can be used in pkgver<br />
<br />
<pre><br />
# Contributor: Lukas Sabota <punkrockguy318@comcast.net><br />
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org<br />
arch=(i686 x86_64)<br />
pkgname=fluxbox-svn<br />
pkgver=4084<br />
pkgrel=1<br />
pkgdesc="Fluxbox-svn is the bleeding edge version of a lightweight yet \<br />
customizable windowmanager for X. This will checkout and package the latest SVN version."<br />
url="http://www.fluxbox.org"<br />
license=<br />
<br />
depends=('bash' 'x-server')<br />
makedepends=('subversion')<br />
conflicts=('blackbox' 'fluxbox' 'fluxbox-devel' 'fluxbox-cvs')<br />
provides=('fluxbox')<br />
<br />
source=()<br />
md5sums=()<br />
<br />
_svntrunk=svn://svn.berlios.de/fluxbox/trunk<br />
_svnmod=fluxbox<br />
<br />
build() {<br />
cd $startdir/src<br />
<br />
if [ -d $_svnmod/.svn ]; then<br />
(cd $_svnmod && svn up -r $pkgver)<br />
else<br />
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod<br />
fi<br />
<br />
msg "SVN checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r $_svnmod $_svnmod-build<br />
cd $_svnmod-build<br />
<br />
./autogen.sh<br />
<br />
# fix for crap fb issue<br />
mkdir data<br />
cp ../$_svnmod/data/keys data/<br />
<br />
./configure --prefix=/usr --enable-xinerama --enable-imlib2 --enable-debug<br />
make || return 1<br />
make DESTDIR=$startdir/pkg/ install<br />
<br />
rm -rf $startdir/src/$_svnmod-build<br />
}<br />
# vim:syntax=sh</pre><br />
<br />
==Example GIT PKGBUILD==<br />
<br />
<pre><br />
arch=(i686 x86_64)<br />
pkgname=compiz-git<br />
pkgver=20060707<br />
pkgrel=1<br />
pkgdesc="Composite and window manager for Xgl"<br />
url="http://en.opensuse.org/Compiz"<br />
license=""<br />
depends=('xgl-cvs' 'mesa-xgl-cvs' 'cairo-devel' 'libxevie' \<br />
'startup-notification' 'libpng' 'libxdamage' \<br />
'libxrandr' 'libwnck-compiz' 'gnome-desktop' 'control-center' \<br />
'libsvg-cairo' 'libxcomposite')<br />
makedepends=('git')<br />
conflicts=()<br />
replaces=()<br />
backup=()<br />
install=compiz.install<br />
source=(compiz-intel-copy-pixel-issue-workaround-1.diff)<br />
md5sums=('10a157b86d528bca2be6731c5eaff7b3')<br />
<br />
_gitroot="git://anongit.freedesktop.org/git/xorg/app/compiz"<br />
_gitname="compiz"<br />
build() {<br />
export CFLAGS="$CFLAGS -I/opt/mesa-xgl-cvs/include"<br />
cd $startdir/src<br />
msg "Connecting to git.freedesktop.org GIT server...."<br />
<br />
if [ -d $startdir/src/$_gitname ] ; then<br />
cd $_gitname && git-pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone $_gitroot<br />
fi<br />
<br />
msg "GIT checkout done or server timeout"<br />
msg "Starting make..."<br />
<br />
cp -r $startdir/src/$_gitname $startdir/src/$_gitname-build<br />
cd $startdir/src/$_gitname-build<br />
patch -Np0 -i ${startdir}/src/compiz-intel-copy-pixel-issue-workaround-1.diff<br />
<br />
ACLOCAL="aclocal -I /opt/gnome/share/aclocal" ./autogen.sh --host=${CHOST} \<br />
--prefix=/usr \<br />
--infodir=/usr/share/info \<br />
--mandir=/usr/man \<br />
--sysconfdir=/opt/gnome/etc \<br />
--enable-gnome \<br />
--enable-libsvg-cairo \<br />
--enable-gconf-dump \<br />
--disable-kde || return 1<br />
make || return 1<br />
make DESTDIR=$startdir/pkg install<br />
<br />
find $startdir/pkg -type f -name '*.la' -exec rm {} \;<br />
} <br />
</pre><br />
As you see, I use "-git" suffix in the pkgname, and two variables, _gitroot and _gitname for identify the repositories and the name of the package.<br />
I need to introduce an if condition: <br />
<pre><br />
if [ -d $startdir/src/$_gitname ] ; then<br />
cd $_gitname && git-pull origin<br />
msg "The local files are updated."<br />
else<br />
git clone $_gitroot<br />
fi<br />
</pre><br />
because we have two commands, one for updating source and one for getting it. I copy the source code in a "-build" directory ( the same thing that we do with -cvs and -svn program ).<br />
<br />
==Example darcs PKGBUILD==<br />
<pre><br />
pkgname=psi-darcs<br />
pkgver=20070404<br />
pkgrel=2<br />
pkgdesc="Psi - Jabber client (with SSL support) darcs version"<br />
makedepends=('darcs' 'qt4>=4.2')<br />
depends=('qt4>=4.2' 'openssl' 'libxss' 'cyrus-sasl' 'aspell') <br />
source=()<br />
conflicts=('psi')<br />
provides=('psi')<br />
url="http://psi-im.org/"<br />
md5sums=()<br />
<br />
_darcsmod="psi"<br />
_darcstrunk="http://dev.psi-im.org/darcs"<br />
<br />
build() {<br />
cd $startdir/src/<br />
# Erasing previous build<br />
msg "Checking for previous build"<br />
# get the sources<br />
if [[ -d psi/_darcs ]]<br />
then<br />
msg "Retrieving missing patches"<br />
cd $_darcsmod<br />
darcs pull -a $_darcstrunk/$_darcsmod<br />
else<br />
msg "Retrieving complete sources"<br />
darcs get --partial --set-scripts-executable $_darcstrunk/$_darcsmod<br />
cd $_darcsmod<br />
fi<br />
<br />
####### Be sure to use Qt4 #######<br />
msg "Configuring Qt4 build environement"<br />
OLDPATH=$PATH<br />
OLDQTDIR=$QTDIR<br />
. /etc/profile.d/qt4.sh<br />
export PATH=$QTDIR/bin:$PATH<br />
###################################<br />
<br />
# building<br />
msg "Starting build"<br />
./configure --prefix=/usr --disable-xmms<br />
make || return 1<br />
make INSTALL_ROOT=$startdir/pkg install<br />
<br />
###### Restore environement #######<br />
msg "Unsetting Qt4 build environment"<br />
QTDIR=$OLDQTDIR<br />
PATH=$OLDPATH<br />
unset OLDPATH OLDQTDIR<br />
###################################<br />
<br />
}<br />
</pre><br />
<br />
==versionpkg - a <tt>makepkg</tt> wrapper for CVS/SVN builds==<br />
This is a very simple script that allows you to easily update your CVS and SVN packages without having to edit the PKGBUILDs manually to enter the date or revision number.<br />
<br />
Simply run this script rather than <tt>makepkg</tt> in the build dir. This script completely removes the need for backtick execution to set the date or tag version in PKGBUILDs.<br />
<br />
To use the script;<br />
* Ensure that pkgver is declared within the first ten lines of the PKGBUILD or it won't work!<br />
* Ensure you have included the following custom variables and checkout command:<br />
* CVS<br />
_cvsroot=<br />
: The root of the CVS server - remember to include a colon (:) after the username as outlined above<br />
_cvsmod=<br />
: Simply the CVS module name you wish to check out e.g.<br />
_cvsroot=":pserver:anonymous:@mplayerhq.hu:/cvsroot/ffmpeg"<br />
_cvsmod="ffmpeg"<br />
: Here is the checkout command for CVS that uses the above variables. The <strong>-D</strong> option is essential for proper use of <code>versionpkg</code> and is best used in combination with the <strong>-f</strong> option. Use of <strong>-D</strong> without <strong>-f</strong> may result in errors<br />
cvs -z9 -q -d $_cvsroot co -D $pkgver -f $_cvsmod<br />
: -z controls the level of compression (1 is low 9 is high)<br />
: -D specifies the date to check out, we use $pkgver as that is set to the current date by the script.<br />
: -q is a quiet switch<br />
* SVN<br />
_svntrunk=<br />
: The address of the SVN trunk<br />
_svnmod=<br />
: Again the module you wish to check out from trun e.g.<br />
_svntrunk=svn://svn.berlios.de/fluxbox/trunk<br />
_svnmod=fluxbox<br />
: Here is the checkout command for SVN that uses the above variables. The <strong>-r</strong> option is essential for proper use of <code>versionpkg</code>.<br />
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod<br />
: Here -r specifies the revision number, we use $pkgver as that is set to the latest revision number by the script.<br />
<br />
===The script!===<br />
To improve security, versionpkg can now be installed directly from [community] <code>pacman -S versionpkg</code>. I strongly recommend that you use that. The script below is purely for illustrative purposes :)<br><br />
Changelog:<br />
* check for both CVS/SVN vars<br />
* If build fails revert to previous pkgver to allow correct gensync operation<br />
* Added support for coloured messages<br />
<pre>#!/bin/bash<br />
<br />
# versionpkg - a makepkg wrapper for building CVS/SVN pkgs<br />
# dibblethewrecker.at.jiwe.org<br />
<br />
# makepkg configuration<br />
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf<br />
<br />
# SUBROUTINES<br />
plain() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e " \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo " $1" >&2<br />
fi<br />
}<br />
msg() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;32m==>\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> $1" >&2<br />
fi<br />
}<br />
warning() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;33m==> WARNING:\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> WARNING: $1" >&2<br />
fi<br />
}<br />
error() {<br />
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then<br />
echo -e "\033[1;31m==> ERROR:\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
else<br />
echo "==> ERROR: $1" >&2<br />
fi<br />
return 1<br />
}<br />
<br />
source ./PKGBUILD<br />
oldpkgver=$pkgver<br />
<br />
if [ ! -z ${_cvsroot} ] && [ ! -z ${_cvsmod} ] ; then<br />
cvsdate=`date +%Y%m%d`<br />
sed -i "1,11 s|pkgver=$oldpkgver|pkgver=$cvsdate|" ./PKGBUILD<br />
makepkg $@<br />
if [ $? -gt 0 ] ; then<br />
error "Reverting pkgver..."<br />
sed -i "1,11 s|pkgver=$cvsdate|pkgver=$oldpkgver|" ./PKGBUILD<br />
fi <br />
elif [ ! -z ${_svntrunk} ] && [ ! -z ${_svnmod} ] ; then<br />
svnrevno=`svn log $_svntrunk --limit 1 | grep -m 1 -o "r.*" | cut -d \| -f 1 | sed s@r@@g`<br />
msg "Current revision number is $svnrevno"<br />
if [ "${1}" != "-f" ] && [ "${oldpkgver}" == "${svnrevno}" ] ; then<br />
error "No new revision available. (use -f to overwrite)"<br />
exit<br />
fi<br />
sleep 3<br />
sed -i "1,11 s|pkgver=$oldpkgver|pkgver=$svnrevno|" ./PKGBUILD<br />
makepkg $@<br />
if [ $? -gt 0 ] ; then<br />
error "Reverting pkgver..."<br />
sed -i "1,11 s|pkgver=$svnrevno|pkgver=$oldpkgver|" ./PKGBUILD<br />
fi <br />
else<br />
error "No SVN or CVS variables found! Aborting..."<br />
exit<br />
fi<br />
</pre></div>Georgek