1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
diff -Naur pkgutils-5.35.0.original/pkgmk.conf pkgutils-5.35.0/pkgmk.conf
--- pkgutils-5.35.0.original/pkgmk.conf 2010-06-26 18:46:59.000000000 +0200
+++ pkgutils-5.35.0/pkgmk.conf 2010-10-06 13:03:43.000000000 +0200
@@ -2,18 +2,19 @@
# /etc/pkgmk.conf: pkgmk(8) configuration
#
-export CFLAGS="-O2 -march=i686 -pipe"
-export CXXFLAGS="-O2 -march=i686 -pipe"
+export CFLAGS="-O2 -march=native -pipe"
+export CXXFLAGS="-O2 -march=native -pipe"
# PKGMK_SOURCE_MIRRORS=()
-# PKGMK_SOURCE_DIR="$PWD"
+PKGMK_SOURCE_DIR="/srv/sources"
# PKGMK_PACKAGE_DIR="$PWD"
-# PKGMK_WORK_DIR="$PWD/work"
+PKGMK_WORK_DIR="/tmp/work"
# PKGMK_DOWNLOAD="no"
# PKGMK_IGNORE_FOOTPRINT="no"
# PKGMK_IGNORE_NEW="no"
# PKGMK_NO_STRIP="no"
# PKGMK_WGET_OPTS=""
-# PKGMK_COMPRESSION_MODE="gz"
+PKGMK_COMPRESSION_MODE="xz"
+PKGMK_LOCALES="fr"
# End of file
diff -Naur pkgutils-5.35.0.original/pkgmk.in pkgutils-5.35.0/pkgmk.in
--- pkgutils-5.35.0.original/pkgmk.in 2010-06-26 18:46:59.000000000 +0200
+++ pkgutils-5.35.0/pkgmk.in 2010-10-06 13:08:33.000000000 +0200
@@ -20,6 +20,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
+# Adjusted for NuTyX attapu by thierryn1 at hispeed dot ch
##
# error codes
@@ -207,9 +208,14 @@
}
make_footprint() {
+if ! (echo $TARGET| grep "kernel" >/dev/null); then
pkginfo --footprint $TARGET | \
sed "s|\tlib/modules/`uname -r`/|\tlib/modules/<kernel-version>/|g" | \
sort -k 3
+else
+ pkginfo --footprint $TARGET | sort -k 3
+fi
+
}
check_md5sum() {
@@ -294,13 +300,30 @@
cd $PKG
- find . -type f -path "*/man/man*/*" | while read FILE; do
+ find . -type f -path "*/share/man*/*" | while read FILE; do
if [ "$FILE" = "${FILE%%.gz}" ]; then
gzip -9 "$FILE"
fi
done
- find . -type l -path "*/man/man*/*" | while read FILE; do
+ find . -type l -path "*/share/man*/*" | while read FILE; do
+ TARGET=`readlink -n "$FILE"`
+ TARGET="${TARGET##*/}"
+ TARGET="${TARGET%%.gz}.gz"
+ rm -f "$FILE"
+ FILE="${FILE%%.gz}.gz"
+ DIR=`dirname "$FILE"`
+
+ if [ -e "$DIR/$TARGET" ]; then
+ ln -sf "$TARGET" "$FILE"
+ fi
+ done
+ find . -type f -path "*/share/info/*" | while read FILE; do
+ if [ "$FILE" = "${FILE%%.gz}" ]; then
+ gzip -9 "$FILE"
+ fi
+ done
+ find . -type l -path "*/share/info/*" | while read FILE; do
TARGET=`readlink -n "$FILE"`
TARGET="${TARGET##*/}"
TARGET="${TARGET%%.gz}.gz"
@@ -388,11 +411,17 @@
if [ $? = 0 ]; then
if [ "$PKGMK_NO_STRIP" = "no" ]; then
- strip_files
+ if ! (echo $TARGET| grep "kernel" >/dev/null); then
+ strip_files
+ fi
fi
compress_manpages
-
+
+ if [ "$PKGMK_KEEP_LOCALES" == "no" ]; then
+ remove_locale
+ fi
+
cd $PKG
info "Build result:"
@@ -529,28 +558,45 @@
print_help() {
echo "usage: `basename $PKGMK_COMMAND` [options]"
echo "options:"
- echo " -i, --install build and install package"
- echo " -u, --upgrade build and install package (as upgrade)"
- echo " -r, --recursive search for and build packages recursively"
- echo " -d, --download download missing source file(s)"
- echo " -do, --download-only do not build, only download missing source file(s)"
- echo " -eo, --extract-only do not build, only extract source file(s)"
- echo " -utd, --up-to-date do not build, only check if package is up to date"
- echo " -uf, --update-footprint update footprint using result from last build"
- echo " -if, --ignore-footprint build package without checking footprint"
- echo " -in, --ignore-new build package, ignore new files in a footprint missmatch"
- echo " -um, --update-md5sum update md5sum"
- echo " -im, --ignore-md5sum build package without checking md5sum"
- echo " -cm, --check-md5sum do not build, only check md5sum"
- echo " -ns, --no-strip do not strip executable binaries or libraries"
- echo " -f, --force build package even if it appears to be up to date"
- echo " -c, --clean remove package and downloaded files"
- echo " -kw, --keep-work keep temporary working directory"
- echo " -cf, --config-file <file> use alternative configuration file"
- echo " -v, --version print version and exit "
- echo " -h, --help print help and exit"
+ echo " -i, --install compile et installe le paquet"
+ echo " -u, --upgrade compile et installe le paquet (met à jour)"
+ echo " -r, --recursive recherche et compile les paquets de façon récursive"
+ echo " -d, --download télécharge les fichiers sources manquants"
+ echo " -do, --download-only télécharge uniquement les fichiers sources sans compiler"
+ echo " -eo, --extract-only extrait uniquement les source sans construire le paquet"
+ echo " -utd, --up-to-date véridie uniquement si le paquet est à jour"
+ echo " -uf, --update-footprint met à jour la signature du paquet résultant de la dernière compilation"
+ echo " -if, --ignore-footprint compile le paquet en ignorant la signature"
+ echo " -in, --ignore-new compile le paquet en ignorant la nouvelle signature"
+ echo " -um, --update-md5sum met à jour le md5sum"
+ echo " -im, --ignore-md5sum compile le paquet en ignorant le md5sum"
+ echo " -cm, --check-md5sum vérifie seulement le md5sum"
+ echo " -ns, --no-strip ne réduit pas les binairess ou librairies"
+ echo " -f, --force force la compilation même si le paquet est à jour"
+ echo " -c, --clean supprime le paquet et les sources"
+ echo " -kw, --keep-work garde les dossiers de travail"
+ echo " -kl, --keep-locale garde les autres locales que celles prédéfinies"
+ echo " -cf, --config-file <file> utiliser un fichier de configuration spécifique"
+ echo " -v, --version affiche uniquement la version "
+ echo " -h, --help affiche uniquement l'aide"
+}
+remove_locale() {
+local DIR FILE
+ cd $PKG
+ find . -type d -path "*/share/locale/*" | while read FILE; do
+ if [ `basename $FILE` = $PKGMK_LOCALES ]; then
+ DIR=`dirname "$FILE"`
+ mv "$FILE" .
+ rm -rf $DIR
+ mkdir $DIR
+ mv `basename "$FILE"` $DIR/
+ break
+ else
+ rm -rf $FILE
+ fi
+
+ done
}
-
parse_options() {
while [ "$1" ]; do
case $1 in
@@ -589,6 +635,8 @@
PKGMK_CLEAN="yes" ;;
-kw|--keep-work)
PKGMK_KEEP_WORK="yes" ;;
+ -kl|--keep-locale)
+ PKGMK_KEEP_LOCALES="yes" ;;
-cf|--config-file)
if [ ! "$2" ]; then
echo "`basename $PKGMK_COMMAND`: option $1 requires an argument"
@@ -620,7 +668,7 @@
exit 0
fi
- for FILE in $PKGMK_PKGFILE $PKGMK_CONFFILE; do
+ for FILE in $PKGMK_CONFFILE $PKGMK_PKGFILE; do
if [ ! -f $FILE ]; then
error "File '$FILE' not found."
exit 1
@@ -735,6 +783,8 @@
PKGMK_CHECK_MD5SUM="no"
PKGMK_NO_STRIP="no"
PKGMK_CLEAN="no"
+PKGMK_KEEP_LOCALES="no"
+PKGMK_LOCALES="fr"
main "$@"
|