forked from pv-oss/oss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (42 loc) · 2.09 KB
/
Makefile
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
# Make file for the SL System Managemant Daemon
DESTDIR = /
LMDDIR = $(DESTDIR)/usr/share/lmd
REQPACKAGES = $(shell cat REQPACKAGES)
VERSION = $(shell test -e ../VERSION && cp ../VERSION VERSION ; cat VERSION)
RELEASE = $(shell cat RELEASE)
NRELEASE = $(shell echo $(RELEASE) + 1 | bc )
HERE = $(shell pwd)
PACKAGE =oss-radius
dist:
if [ -e $(PACKAGE) ]; then rm -rf $(PACKAGE); fi
mkdir $(PACKAGE)
cp Makefile $(PACKAGE)/
rsync -aC raddb alibs tools $(PACKAGE)/
tar cjf $(PACKAGE).tar.bz2 $(PACKAGE)
sed "s/@VERSION@/$(VERSION)/" $(PACKAGE).spec.in > $(PACKAGE).spec
sed -i "s/@RELEASE@/$(RELEASE)/" $(PACKAGE).spec
if [ -d /data1/OSC/home\:openschoolserver/$(PACKAGE) ] ; then \
cd /data1/OSC/home\:openschoolserver/$(PACKAGE); osc up; cd $(HERE);\
cp $(PACKAGE).tar.bz2 $(PACKAGE).spec /data1/OSC/home\:openschoolserver/$(PACKAGE); \
cd /data1/OSC/home\:openschoolserver/$(PACKAGE); \
osc ci -m "New Build Version"; \
fi
echo $(NRELEASE) > RELEASE
install:
mkdir -p $(DESTDIR)/usr/share/oss/templates/oss-radius
rsync -aC raddb/ $(DESTDIR)/usr/share/oss/templates/oss-radius/
mkdir -p $(DESTDIR)/usr/share/oss/tools/oss-radius
rsync -aC tools/ $(DESTDIR)/usr/share/oss/tools/oss-radius/
mkdir -p $(DESTDIR)/usr/share/lmd/alibs
rsync -aC alibs/ $(DESTDIR)/usr/share/lmd/alibs/
package: dist
rm -rf /usr/src/packages/*
cd /usr/src/packages; mkdir -p BUILDROOT BUILD SOURCES SPECS SRPMS RPMS RPMS/athlon RPMS/amd64 RPMS/geode RPMS/i686 RPMS/pentium4 RPMS/x86_64 RPMS/ia32e RPMS/i586 RPMS/pentium3 RPMS/i386 RPMS/noarch RPMS/i486
cp $(PACKAGE).tar.bz2 /usr/src/packages/SOURCES
sed -i '/BuildRequires: -brp-check-suse/d' $(PACKAGE).spec
rpmbuild -ba $(PACKAGE).spec
for i in `ls /data1/PACKAGES/rpm/noarch/$(PACKAGE)* 2> /dev/null`; do rm $$i; done
for i in `ls /data1/PACKAGES/src/$(PACKAGE)* 2> /dev/null`; do rm $$i; done
cp /usr/src/packages/SRPMS/$(PACKAGE)-*.src.rpm /data1/PACKAGES/src/
cp /usr/src/packages/RPMS/noarch/$(PACKAGE)-*.noarch.rpm /data1/PACKAGES/rpm/noarch/
createrepo -p /data1/PACKAGES/