rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | package_arch = $(subst -,_,${PACKAGE_ARCH}) |
| 2 | NAME = sncfg |
| 3 | ETC_PATH = mnt |
| 4 | LIB = lib$(NAME).a lib$(NAME).so |
| 5 | INSTALL = _install |
| 6 | UNINSTALL = _uninstall |
| 7 | |
| 8 | include $(PREFIX)/Makefile.prebuilt.template |
| 9 | |
| 10 | |
| 11 | all: |
| 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 | |
| 53 | clean: |
| 54 | rm -rf bin/ doc/ ./$(base_libdir) usr/ test/ ./$(base_sbindir) etc/ mnt/ tmp/ |
| 55 | |
| 56 | |