blob: be2df40d932e078dd1f835602efc4e35701af01e [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001package_arch = $(subst -,_,${PACKAGE_ARCH})
2NAME = sncfg
3ETC_PATH = mnt
4LIB = lib$(NAME).a lib$(NAME).so
5INSTALL = _install
6UNINSTALL = _uninstall
7
8include $(PREFIX)/Makefile.prebuilt.template
9
10
11all:
12_install:
13 find -name "*.$(package_arch).rpm" | while read i; do ${bindir}/rpm2cpio $${i} | cpio -idmv ; done
14 #rootfs init.d script
15 #mkdir -p $(ROOT)/etc/init.d
16 #cp -af ./etc/init.d/* $(ROOT)/etc/init.d/
17 mkdir -p $(ROOT)/usr
18 cp -f ./usr/reinit_reason $(ROOT)/usr/
19 # shared library
20 mkdir -p $(ROOT)/$(base_libdir)
21 cp -f ./$(base_libdir)/lib$(NAME).so $(ROOT)/$(base_libdir)/
22 mkdir -p $(ROOT)/sbin
23 cp -rf ./sbin/* $(ROOT)/sbin/
24 # factory default configuration and translations
25 mkdir -p $(ROOT)/tmp
26 mkdir -p $(ROOT)/$(ETC_PATH)/sncfg
27 mkdir -p $(ROOT)/usr/cfg
28 -cp -rf ./usr/cfg/*.cfg $(ROOT)/usr/cfg/
29 mkdir -p $(ROOT)/sbin
30 cp -f ./sbin/rcenable $(ROOT)/sbin/
31 mkdir -p $(ROOT)/etc/rc.d
32 cd $(ROOT)/etc/rc.d && rm -f S00sncfgd && ln -sf ./$(bindir)/sncfgd S00sncfgd
33 cd $(ROOT)/etc/rc.d && rm -f S02sncfgd_sc_stage0 && ln -sf ./$(bindir)/sncfgd_sc_stage0 S02sncfgd_sc_stage0
34 cd $(ROOT)/etc/rc.d && rm -f S20sncfgd_sc_stage1 && ln -sf ./$(bindir)/sncfgd_sc_stage1 S20sncfgd_sc_stage1
35 # rootfs link.d event
36 mkdir -p $(ROOT)/sbin/link.d/wan
37 cp -f ./sbin/link.d/wan/* $(ROOT)/sbin/link.d/wan/S99wanlink
38 #Include headers
39 #mkdir -p $(ROOT)/include/
40 #cp -rf ./$(includedir)/* $(ROOT)/include/
41
42_uninstall:
43 rm -f $(ROOT)/etc/init.d/sncfgd*
44 rm -f $(ROOT)/etc/rc.d/*sncfg*
45 rm -rf $(ROOT)/$(ETC_PATH)/sncfg
46 rm -f $(ROOT)/sbin/apinfo
47 rm -f $(ROOT)/sbin/rcenable
48 rm -f $(ROOT)/sbin/sncfgd
49 rm -f $(ROOT)/sbin/sncfg-restore.sh
50 rm -f $(ROOT)/sbin/link.d/wan/S99wanlink
51 rm -f $(ROOT)/usr/reinit_reason
52
53clean:
54 rm -rf bin/ doc/ ./$(base_libdir) usr/ test/ ./$(base_sbindir) etc/ mnt/ tmp/
55
56