1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 19:54:48 +08:00

Fixed several bugs in rpm package

This commit is contained in:
Senorsen 2015-02-08 22:35:28 +08:00
parent 1ede8b984f
commit 3daa7163e9
4 changed files with 35 additions and 21 deletions

View File

@ -22,23 +22,7 @@ mkdir -p debian/DEBIAN
cat > debian/DEBIAN/postinst <<EOF
#!/bin/sh
cp /usr/share/zjunet/qsc.list /etc/apt/sources.list.d/qsc.list
chmod 644 /etc/apt/sources.list.d/qsc.list
apt-key add /usr/share/zjunet/qsc.public.key 2>&1 >/dev/null || true
cat <<BANNER
----------------------------------------------------------------------
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License Version 3 for more details.
You can ask questions, file a bug or make PRs here:
* https://github.com/QSCTech/zjunet
----------------------------------------------------------------------
BANNER
/usr/share/zjunet/zjunet-postinst
EOF
chmod 755 debian/DEBIAN/postinst

View File

@ -34,6 +34,7 @@ echo 'mkdir -p $RPM_BUILD_ROOT/usr/bin' >> zjunet.spec
echo 'mkdir -p $RPM_BUILD_ROOT/usr/lib/zjunet' >> zjunet.spec
echo 'mkdir -p $RPM_BUILD_ROOT/usr/share/zjunet' >> zjunet.spec
echo 'install -m 755 zjunet $RPM_BUILD_ROOT/usr/bin/zjunet' >> zjunet.spec
echo 'install -m 755 zjunet-postinst $RPM_BUILD_ROOT/usr/share/zjunet/zjunet-postinst' >> zjunet.spec
cd lib
for f in *.sh; do
echo "install -m 755 lib/$f \$RPM_BUILD_ROOT/usr/lib/zjunet/$f" >> ../zjunet.spec
@ -47,6 +48,7 @@ echo "%defattr(-,root,root)" >> zjunet.spec
echo "/usr/bin/zjunet" >> zjunet.spec
echo "/usr/share/zjunet/qsc.public.key" >> zjunet.spec
echo "/usr/share/zjunet/qsc.repo" >> zjunet.spec
echo "/usr/share/zjunet/zjunet-postinst" >> zjunet.spec
cd lib
for f in *.sh; do
echo "/usr/lib/zjunet/$f" >> ../zjunet.spec
@ -57,9 +59,6 @@ echo "%clean" >> zjunet.spec
echo 'rm -rf $RPM_BUILD_ROOT' >> zjunet.spec
echo "" >> zjunet.spec
echo "%post" >> zjunet.spec
echo "cp /usr/share/zjunet/qsc.public.key /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66 || true" >> zjunet.spec
echo "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66 || true" >> zjunet.spec
echo "cp /usr/share/zjunet/qsc.repo /etc/yum.repos.d/qsc.repo || true" >> zjunet.spec
echo "/usr/share/zjunet/zjunet-postinst || true" >> zjunet.spec
echo "" >> zjunet.spec
echo "%changelog" >> zjunet.spec

View File

@ -1 +1 @@
0.2.4-1
0.2.4-2

31
miscellaneous/zjunet-postinst Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
command -v apt-key 2>&1 >/dev/null && [ -d /etc/apt ] && {
cp /usr/share/zjunet/qsc.list /etc/apt/sources.list.d/qsc.list
chmod 644 /etc/apt/sources.list.d/qsc.list
apt-key add /usr/share/zjunet/qsc.public.key 2>&1 >/dev/null || true
echo "Added apt list."
}
command -v rpm 2>&1 >/dev/null && [ -d /etc/pki/rpm-gpg ] && [ -d /etc/yum.repos.d ] && {
cp /usr/share/zjunet/qsc.public.key /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66
chmod 644 /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-QSC-COMP66
cp /usr/share/zjunet/qsc.repo /etc/yum.repos.d/qsc.repo || true
echo "Added yum repo."
}
cat <<BANNER
----------------------------------------------------------------------
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License Version 3 for more details.
You can ask questions, file a bug or make PRs here:
* https://github.com/QSCTech/zjunet
----------------------------------------------------------------------
BANNER