1 #--------------------------------------------------------------------
2 #to make Mentor executable
3 #--------------------------------------------------------------------
5 #devbase est fait sur le nom de dieux goth
6 #Odin,Gaus,Donar,Volla,Phol
8 ifeq ("$(ORIG)","mercier")
11 ifeq ("$(ORIG)","longueuil")
15 DEVDIR=`(cd /home/safe ; pwd)`/safetst/$(DEVBASE)
16 #--------------------------------------------------------------------
18 @ $(MAKE) $(NCPU) -s fdebug
20 devprod : fclean chkmake
21 @ $(MAKE) $(NCPU) -s fprod
23 chkmake : Makefile.inc Makefile
28 @ for i in $(PRIVDIRS) ; \
30 echo "Doing now \"$$i clean\"" ; \
31 $(MAKE) -s -C $$i clean ; \
33 @ rm -fr $(RPMDIR)/SOURCES/$(APLR)*.tgz \
38 @ for i in $(PRIVDIRS) ; \
40 echo "Doing: $$i debug" ; \
41 $(MAKE) -s -C $$i debug ; \
46 @ for i in $(PRIVDIRS) ; \
48 echo "Doing: $$i prod" ; \
49 $(MAKE) -s -C $$i prod ; \
52 #--------------------------------------------------------------------
53 #to test application localy
55 @ $(MAKE) ACTION="boot cont" vzgotry
58 - exec app/$(APPNAME) -b $(DEVDIR) -v -f -d9 $(ACTION)
60 #--------------------------------------------------------------------
61 #to save the current distribution
63 @ echo "starting RCS process"
64 @ support/sauver $(SRC)
65 @ for i in $(ALLDIRS) ; \
67 $(MAKE) -s -C $$i $@ ; \
69 @ echo "RCS process completed"
70 #--------------------------------------------------------------------
71 #creation d'un band de test
74 if [ -z $(DEVBASE) ] ; then \
75 echo "DEVBASE environment variable is missing" ; \
77 echo "Starting to build devbase \"$(DEVBASE)\"" ;\
83 @ $(MAKE) -s fclean fdebug
84 @ echo "Creating \"$(DEVBASE)\" test executable";
86 if [ -d $(DEVDIR) ] ; then \
87 rm -fr $(DEVDIR)/* ; \
92 @ #creating basic prexisting system directory
94 $(DEVDIR)/$(VZDIR)/cont/.oldroot \
95 $(DEVDIR)/$(VZDIR)/cont/rootfs \
98 $(DEVDIR)/var/lock/$(APPNAME) \
100 @ echo "\"$(DEVBASE)\" now ready"
102 #--------------------------------------------------------------------
103 #to make a full distribution
106 $(MAKE) dorpm_distrib
107 #--------------------------------------------------------------------
110 @ ssh -q -Y -t $(XTSTSYS) sudo \
111 rm -f ~safe/rpmbuild/RPMS/i586/$(APPNAME)*.i586.rpm
112 @ ssh -q -Y -t $(XTSTSYS) sudo \
113 rm -f ~safe/$(APPNAME)*.src.rpm
114 @ scp -q $(APPNAME)*.src.rpm $(XTSTSYS):
115 @ ssh -Y -t $(XTSTSYS) \
116 "rpmbuild --rebuild $(APPNAME)*.src.rpm"
117 @ ssh -Y -t $(XTSTSYS) sudo \
118 rpm -Uhv ~safe/rpmbuild/RPMS/i586/$(APPNAME)*.i586.rpm
121 @ ssh $(TSTSYS).safe.ca \
122 "rm -fr $(APPNAME)-*.x86_64.rpm"
124 $(RPMDIR)/RPMS/x86_64/$(APPNAME)-*.x86_64.rpm \
126 @ ssh -Y -t $(TSTSYS).safe.ca sudo \
127 rpm -Uhv ~safe/$(APPNAME)-*.x86_64.rpm
130 @ echo "Making RPM binary"
131 @ rm -fr $(RPMDIR)/RPMS/x86_64/$(APPNAME)-*.x86_64.rpm
132 @ rm -fr $(APPNAME)-*.x86_64.rpm
133 @ rpm --quiet -Uhv $(APLR)*.src.rpm > /dev/null
138 $(RPMDIR)/SPECS/$(APPNAME).spec
139 @ cp $(RPMDIR)/RPMS/x86_64/$(APPNAME)-*.x86_64.rpm .
140 @ echo "RPM binary completed"
144 @ rpmlint $(APPNAME)-*.x86_64.rpm
147 @ ssh $(FTPSITE).safe.ca \
148 mkdir -p /var/ftp/pub/linux/vzgot/archives
149 @ ssh $(FTPSITE).safe.ca \
150 mv /var/ftp/pub/linux/vzgot/*.rpm \
151 /var/ftp/pub/linux/vzgot/archives
152 @ scp -p support/{README,QUICK-START} \
154 $(FTPSITE).safe.ca:/var/ftp/pub/linux/vzgot
155 @ grep -v '^[#.*]' Changes | \
156 ssh $(FTPSITE).safe.ca \
157 "cat - > /var/ftp/pub/linux/vzgot/Changes"
158 #--------------------------------------------------------------------
159 #to make the RPM SRC file
161 @ echo "Making RPM src"
164 $(RPMDIR)/SOURCES/$(APLR)*.tgz \
166 @ mv $(APLR).tgz $(RPMDIR)/SOURCES
169 --define "_topdir /home/safe/RPM" \
170 support/$(APPNAME).spec > /dev/null 2>&1
171 @ mv $(RPMDIR)/SRPMS/$(APLR)*.src.rpm .
172 @ echo "RPM src completed"
182 $(APLR)/etc/sysconfig \
185 @ #copying version, build_date and info file
186 @ date > $(APLR)/$(APLR).build_date
189 @ #adding group information
190 @ cp -ap cgroup.d/devices.* $(APLR)/cgroup.d
191 @ #adding application sources
192 @ cp -a lib/{*.c,*.h} $(APLR)/lib
193 @ cp -a app/*.c $(APLR)/app
194 @ cp -a shell/vzgot.* $(APLR)/shell
195 @ #adding configuration file
196 @ cp -a support/vzgot_config $(APLR)/conf
197 @ cp -a support/vzgot_list $(APLR)/conf
198 @ cp -a support/redhat_init.sh $(APLR)/conf
199 @ cp -a support/{README,QUICK-START} $(APLR)
200 @ grep -v '^[#.*]' Changes > $(APLR)/Changes
201 @ cp -a etc/{users,groups,sudoers} $(APLR)/etc
202 @ cp -a etc/{resolv.conf,shadow} $(APLR)/etc
203 @ cp -a etc/iptables $(APLR)/etc/sysconfig
204 @ cp -a etc/snmpd.conf $(APLR)/etc/snmp
205 @ #adding construction file
206 @ cp -a Makefile.inc $(APLR)/Makefile
207 @ @ cp -a lib/Makefile.inc $(APLR)/lib/Makefile
208 @ @ cp -a app/Makefile.inc $(APLR)/app/Makefile
209 @ tar zcf $(APLR).tgz $(APLR)
212 #--------------------------------------------------------------------
216 @ echo "Ready for \"git commit -a\""
218 #--------------------------------------------------------------------
225 etc cgroup.d shell support
231 #--------------------------------------------------------------------
232 include ./Makefile.inc
233 include /etc/saferepo/Makefile.dorpm
234 #--------------------------------------------------------------------
238 XTSTSYS = 192.219.254.58
240 #====================================================================
241 .PHONY: sauve binary rpm rpmlint chkmake togit
242 #--------------------------------------------------------------------