@@ -18,17 +18,13 @@ if ! echo "$OUTPUT_TIMESTAMP" | grep -Eq "^$d{4}-$d{2}-$d{2}T$d{2}:$d{2}:$d{2}Z$
18
18
exit 1
19
19
fi
20
20
21
- # Build directory containing temporary files
21
+ # Build directory containing temporary files, all the paths are relative to it.
22
22
#
23
23
build=CMakeFiles
24
24
25
- # Directory containing the distribution archives
26
- #
27
- dist=" $build /dist"
28
-
29
25
# Create source directory
30
- mkdir -p " $dist "
31
- OUTPUT_DIR=" $build / apache-log4cxx-$VERSION "
26
+ mkdir -p " $build / dist"
27
+ OUTPUT_DIR=" apache-log4cxx-$VERSION "
32
28
if [ -f " $OUTPUT_DIR " ]; then
33
29
if [ ! -d " $OUTPUT_DIR " ]; then
34
30
echo File " $OUTPUT_DIR " is not a directory >& 2
@@ -39,7 +35,7 @@ if [ -f "$OUTPUT_DIR" ]; then
39
35
exit 1
40
36
fi
41
37
fi
42
- mkdir -p " $OUTPUT_DIR "
38
+ mkdir -p " $build / $ OUTPUT_DIR"
43
39
44
40
# Copy files to directory
45
41
cp -r \
@@ -52,13 +48,13 @@ cp -r \
52
48
src \
53
49
liblog4cxx.pc.in \
54
50
liblog4cxx-qt.pc.in \
55
- " $OUTPUT_DIR "
56
- rm -r " $OUTPUT_DIR " /src/main/abi-symbols
51
+ " $build / $ OUTPUT_DIR"
52
+ rm -r " $build / $ OUTPUT_DIR" /src/main/abi-symbols
57
53
58
54
# Create TAR file
59
55
#
60
56
# See https://reproducible-builds.org/docs/archives/ for reproducibility tips
61
- TAR_ARCHIVE=" $ dist /apache-log4cxx-$VERSION .tar.gz"
57
+ TAR_ARCHIVE=" dist/apache-log4cxx-$VERSION .tar.gz"
62
58
echo ' Tar version:'
63
59
tar --version | sed -e ' s/^/\t/'
64
60
echo ' Gzip version:'
@@ -68,43 +64,44 @@ if [ -f "$TAR_ARCHIVE" ]; then
68
64
exit 1
69
65
fi
70
66
71
- tar --transform=" s!^$OUTPUT_DIR !apache-log4cxx-$VERSION !" \
72
- --mtime=" $OUTPUT_TIMESTAMP " \
73
- --owner=0 --group=0 --numeric-owner \
74
- --sort=name \
75
- --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
76
- --create --gzip --file " $TAR_ARCHIVE " " $OUTPUT_DIR "
77
-
78
- echo -e Tar archive: " $TAR_ARCHIVE "
67
+ (
68
+ cd " $build "
69
+ tar --mtime=" $OUTPUT_TIMESTAMP " \
70
+ --owner=0 --group=0 --numeric-owner \
71
+ --sort=name \
72
+ --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
73
+ --create --gzip --file " $TAR_ARCHIVE " " $OUTPUT_DIR "
74
+ )
75
+ echo -e Tar archive: " $build /$TAR_ARCHIVE "
79
76
80
77
# Create ZIP file
81
78
#
82
79
# See https://reproducible-builds.org/docs/archives/ for reproducibility tips
83
80
# Change the mtime of all files
84
- ZIP_ARCHIVE=" $ dist /apache-log4cxx-$VERSION .zip"
81
+ ZIP_ARCHIVE=" dist/apache-log4cxx-$VERSION .zip"
85
82
echo ' Zip version:'
86
83
zip --version | sed ' s/^/\t/'
87
84
if [ -f " $ZIP_ARCHIVE " ]; then
88
85
echo Archive " $ZIP_ARCHIVE " already exists >& 2
89
86
exit 1
90
87
fi
91
88
92
- find " $OUTPUT_DIR " -exec touch --date=" $OUTPUT_TIMESTAMP " -m {} +
89
+ find " $build / $ OUTPUT_DIR" -exec touch --date=" $OUTPUT_TIMESTAMP " -m {} +
93
90
# Sort files and zip.
94
91
(
95
92
cd " $build "
96
- find apache-log4cxx- $VERSION -print0 |
93
+ find " $OUTPUT_DIR " -print0 |
97
94
LC_ALL=C sort -z |
98
- xargs -0 zip -q -X dist/apache-log4cxx- $VERSION .zip
95
+ xargs -0 zip -q -X " $ZIP_ARCHIVE "
99
96
)
100
97
101
- echo -e ZIP archive: " $ZIP_ARCHIVE "
98
+ echo -e ZIP archive: " $build / $ ZIP_ARCHIVE"
102
99
103
100
# Generate hashes
104
101
(
105
- cd " $dist "
106
- for format in tar.gz zip ; do
107
- sha256sum apache-log4cxx- $VERSION . $format > apache-log4cxx- $VERSION . $format . sha256
108
- sha512sum apache-log4cxx- $VERSION . $format > apache-log4cxx- $VERSION . $format . sha512
102
+ cd " $build / dist"
103
+ for file in * ; do
104
+ sha256sum " $file " > " $file . sha256"
105
+ sha512sum " $file " > " $file . sha512"
109
106
done
110
107
)
0 commit comments