-
Notifications
You must be signed in to change notification settings - Fork 6
/
ppolicy.build
executable file
·66 lines (58 loc) · 2.21 KB
/
ppolicy.build
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
#!/bin/sh
NAME=ppolicy
VERSION=2.7.0
RELEASE=0beta22
RPMDIR=${HOME}/rpmbuild
perl -p -i -e "s/^Version: .*/Version: ${VERSION}/" ppolicy.spec
perl -p -i -e "s/^Release: .*/Release: ${RELEASE}/" ppolicy.spec
perl -p -i -e "s/^(\s*version\s*=\s*).*(,.*)\$/\1'${VERSION}'\2/" setup.py
perl -p -i -e "s/^(\s*logging.getLogger\(\).info\(\"version:).*(\"\)).*/\1 ${VERSION}-${RELEASE}\2/" ppolicy.tap
ppolicy/test.py --doc > MODULES
mkdir -p ${NAME}-${VERSION}
#mkdir -p ${NAME}-${VERSION}/doc
mkdir -p ${NAME}-${VERSION}/${NAME}
rm ppolicy.state; touch ppolicy.state
cp \
NEWS \
README \
MODULES \
TODO \
TESTS \
setup.py \
ppolicy.conf \
ppolicy.state \
ppolicy.init \
ppolicy.service \
ppolicy.sysconfig \
ppolicy.spec \
ppolicy.tap \
ppolicy.sql \
${NAME}-${VERSION}
#cp ppolicy.xml ${NAME}-${VERSION}/doc
find ppolicy -name "*.py" -o -name "*.dat" | while read FILE; do
mkdir -p ${NAME}-${VERSION}/`dirname ${FILE}`
cp ${FILE} ${NAME}-${VERSION}/${FILE}
done
#xsltproc -o ${NAME}-${VERSION}/doc/ppolicy.html /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl ${NAME}-${VERSION}/doc/ppolicy.xml
#links -dump -no-home -no-numbering -no-references ${NAME}-${VERSION}/doc/ppolicy.html > ${NAME}-${VERSION}/doc/ppolicy.txt
#xsltproc -o ${NAME}-${VERSION}/doc/ppolicy.fo /usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl ${NAME}-${VERSION}/doc/ppolicy.xml
#fop -fo ${NAME}-${VERSION}/doc/ppolicy.fo -pdf ${NAME}-${VERSION}/doc/ppolicy.pdf
#rm -rf ${NAME}-${VERSION}/doc/ppolicy.fo
#tar cjf ${NAME}-${VERSION}.tar.bz2 ${NAME}-${VERSION}
tar czf ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
#cp -r DEBIAN ${NAME}-${VERSION}
#dpkg-deb --build ${NAME}-${VERSION}
rm -rf ${NAME}-${VERSION}
rpmbuild -ta ${NAME}-${VERSION}.tar.gz
mv -f ${RPMDIR}/SRPMS/${NAME}-${VERSION}*.src.rpm .
mv -f ${RPMDIR}/RPMS/noarch/${NAME}-${VERSION}*.noarch.rpm .
#rpmsign --addsign ${NAME}-${VERSION}*.noarch.rpm
if [ x${RELEASE//[0-9]/} == "xrc" ]; then
mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}${RELEASE/[0-9]/}.tar.gz
fi
if [ x${RELEASE//[0-9]/} == "xalpha" ]; then
mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}${RELEASE/[0-9]/}.tar.gz
fi
if [ x${RELEASE//[0-9]/} == "xbeta" ]; then
mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}${RELEASE/[0-9]/}.tar.gz
fi