Browse Source

use varible to refer to version

pull/2990/head
T.J. Yang 9 years ago
parent
commit
937db50f4a
  1. 28
      contrib/Makefile

28
contrib/Makefile

@ -1,18 +1,22 @@
#Usage: cd contrib;make
RPM=rpm RPM=rpm
ALL=$(RPM) ALL=$(RPM)
WDIR=$(HOME) WDIR=$(HOME)
VER=0.9
REV=20
RPMVERSION=$(VER)-$(REV)
GOGSVERSION=gogs-$(VER).$(REV)
############################################################################## ##############################################################################
# standard targets (all, clean, distclean, devclean, install) # standard targets (all, clean, installrpm,removerpm)
all: $(ALL) all: $(ALL)
clean: clean:
find .. -type f -name "*~" -exec rm -f {} \; find .. -type f -name "*~" -exec rm -f {} \;
(rm -rf $(WDIR)/rpmbuild/RPMS/x86_64/gogs-0.9-20.x86_64.rpm \ (rm -rf $(WDIR)/rpmbuild/RPMS/x86_64/gogs-$(RPMVERSION).x86_64.rpm \
$(WDIR)/rpmbuild/SRPMS/gogs-0.9-20.src.rpm \ $(WDIR)/rpmbuild/SRPMS/gogs-$(RPMVERSION).src.rpm \
../gogs-0.9.20.tar.gz) ../$(GOGSVERSION).tar.gz)
# rpm making automation for CentOS/RHEL. # rpm making automation for CentOS/RHEL.
@ -30,13 +34,13 @@ endif
# RPM_ARCH := noarch # RPM_ARCH := noarch
rpm: rpm:
# @create gogs tar ball. # @create gogs tar ball.
(cd ..;rm -f gogs-0.9.20) (cd ..;rm -f $(GOGSVERSION))
(cd ..;ln -s . gogs-0.9.20) (cd ..;ln -s . $(GOGSVERSION))
(cd ..;tar zhcf gogs-0.9.20.tar.gz --exclude gogs-0.9.20/gogs-0.9.20.tar.gz --exclude gogs-0.9.20/gogs-0.9.20 --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .git* gogs-0.9.20/) (cd ..;tar zhcf $(GOGSVERSION).tar.gz --exclude $(GOGSVERSION)/$(GOGSVERSION).tar.gz --exclude $(GOGSVERSION)/$(GOGSVERSION) --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .git* $(GOGSVERSION)/)
(cd ..;rm -f gogs-0.9.20) (cd ..;rm -f $(GOGSVERSION))
# build the rpm using rpmbuild from ./rmbuild as topdir # build the rpm using rpmbuild from ./rmbuild as topdir
rm -rf ${WDIR}/rpmbuild && mkdir -p ${WDIR}/rpmbuild/SOURCES rm -rf ${WDIR}/rpmbuild && mkdir -p ${WDIR}/rpmbuild/SOURCES
cp ../gogs-0.9.20.tar.gz ${WDIR}/rpmbuild/SOURCES/gogs-0.9.20.tar.gz cp ../$(GOGSVERSION).tar.gz ${WDIR}/rpmbuild/SOURCES/$(GOGSVERSION).tar.gz
rpmbuild -ba --define "_topdir ${WDIR}/rpmbuild" ./gogs.spec rpmbuild -ba --define "_topdir ${WDIR}/rpmbuild" ./gogs.spec
gitcommit: gitcommit:
git commit -a -m "lazy commit via make gitpush" git commit -a -m "lazy commit via make gitpush"
@ -45,6 +49,6 @@ gitpush:
git push origin develop git push origin develop
installrpm: installrpm:
sudo $(RPM) -Uvh $(home)/rpmbuild/RPMS/x86_64/gogs-0.9-20.x86_64.rpm sudo $(RPM) -Uvh $(home)/rpmbuild/RPMS/x86_64/gogs-$(RPMVERSION).x86_64.rpm
removerpm: removerpm:
sudo $(RPM) -e gogs sudo $(RPM) -e gogs

Loading…
Cancel
Save