]>
Commit | Line | Data |
---|---|---|
6937c365 FM |
1 | #!/bin/sh |
2 | ||
3 | Sources="." | |
4 | Target=".." | |
5 | ||
6 | Version=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p') | |
7 | if [ -z "$Version" ] ; then | |
8 | echo "No version found" | |
9 | exit 1 | |
10 | fi | |
11 | Revision=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p') | |
12 | if [ -z "$Revision" ] ; then | |
13 | echo "No revision found" | |
14 | exit 1 | |
15 | fi | |
16 | Version="$Version.$Revision" | |
17 | ||
18 | VersionCheck=$(cat "$Sources/configure.in" | sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p') | |
19 | if [ "x$Version" != "x$VersionCheck" ] ; then | |
20 | echo "CMakeLists and configure doesn't refer to the same version" | |
21 | exit 1 | |
22 | fi | |
23 | ||
24 | SargList="$Target/sarglist.txt.unsort" | |
25 | SortList="$Target/sarglist.txt" | |
aee4b2ef | 26 | DirList="$Target/sargdir.txt" |
6937c365 | 27 | ExcludeList="$Target/sargexclude.txt" |
aee4b2ef | 28 | ArchiveFile="$Target/sarg-$Version.tar" |
6937c365 FM |
29 | |
30 | SedSources=$(echo "$Sources" | sed -e 's/\./\\./') | |
31 | ls $Sources/*.c | sed -e "s/^$SedSources\///" > $SargList | |
32 | ls $Sources/include/*.h | sed -e "s/^$SedSources\///" >> $SargList | |
33 | ls $Sources/po/*.{po,gmo,pot} | sed -e "s/^$SedSources\///" >> $SargList | |
34 | ||
35 | echo " | |
36 | config.h | |
37 | aclocal.m4 | |
38 | BETA-TESTERS | |
39 | ChangeLog | |
40 | CMakeLists.txt | |
6937c365 FM |
41 | configure.in |
42 | CONTRIBUTORS | |
43 | COPYING | |
44 | css.tpl | |
45 | DONATIONS | |
46 | Doxyfile | |
47 | exclude_codes | |
48 | htaccess | |
49 | LICENSE | |
50 | Makefile.in | |
51 | README | |
52 | README_cmake | |
53 | sarg.1 | |
54 | sarg.conf | |
55 | user_limit_block | |
56 | cfgaux | |
57 | documentation | |
58 | fonts | |
59 | images | |
60 | include/config.h.in | |
61 | sarg-php | |
a91a1f21 | 62 | sarg_manpage.xml |
6937c365 FM |
63 | po/remove-potcdate.sin |
64 | po/Makefile.in.in | |
65 | po/POTFILES.in | |
66 | po/quot.sed | |
67 | po/Rules-quot | |
68 | po/insert-header.sin | |
69 | po/ChangeLog | |
70 | po/LINGUAS | |
71 | po/en@quot.header | |
72 | po/en@boldquot.header | |
73 | po/boldquot.sed | |
74 | po/Makevars | |
75 | sorttable/sorttable.js | |
76 | " >> $SargList | |
77 | ||
aee4b2ef FM |
78 | [ -f "$DirList" ] && rm "$DirList" |
79 | cat $SargList | while read file | |
80 | do | |
81 | [ -z "$file" ] && continue | |
82 | if [ -f "$file" ] ; then | |
83 | echo "$file" >> "$DirList" | |
84 | elif [ -d "$file" ] ; then | |
85 | find "$file" -type f >> "$DirList" | |
86 | else | |
87 | echo "Unknown file type $file" | |
88 | exit 1 | |
89 | fi | |
90 | done | |
91 | rm "$SargList" | |
92 | ||
93 | sort -u "$DirList" | sed -e '/^$/d' > "$SortList" | |
94 | rm "$DirList" | |
6937c365 FM |
95 | |
96 | echo " | |
97 | */.svn | |
98 | */.git | |
99 | *~ | |
100 | *.o | |
101 | .gitignore | |
102 | " > "$ExcludeList" | |
103 | ||
aee4b2ef FM |
104 | tar cf "$ArchiveFile" -C "$Sources" --files-from="$SortList" --no-recursion --transform="s,^,sarg-$Version/," --owner root --group root --mode 644 |
105 | tar rf "$ArchiveFile" -C "$Sources" "configure" --exclude-from="$ExcludeList" --transform="s,^,sarg-$Version/," --owner root --group root --mode 755 | |
106 | gzip -f "$ArchiveFile" | |
107 | CompressFile="$ArchiveFile.gz" | |
6937c365 FM |
108 | |
109 | md5sum $CompressFile > "$Target/sarg-$Version.md5sum" | |
110 | echo "md5sum:" | |
111 | cat "$Target/sarg-$Version.md5sum" | |
112 | ||
113 | sha1sum $CompressFile > "$Target/sarg-$Version.sha1sum" | |
114 | echo "sha1sum:" | |
115 | cat "$Target/sarg-$Version.sha1sum" | |
116 | ||
117 | sha256sum $CompressFile > "$Target/sarg-$Version.sha256sum" | |
118 | echo "sha256sum:" | |
119 | cat "$Target/sarg-$Version.sha256sum" |