blob: be2df40d932e078dd1f835602efc4e35701af01e [file] [log] [blame]
package_arch = $(subst -,_,${PACKAGE_ARCH})
NAME = sncfg
ETC_PATH = mnt
LIB = lib$(NAME).a lib$(NAME).so
INSTALL = _install
UNINSTALL = _uninstall
include $(PREFIX)/Makefile.prebuilt.template
all:
_install:
find -name "*.$(package_arch).rpm" | while read i; do ${bindir}/rpm2cpio $${i} | cpio -idmv ; done
#rootfs init.d script
#mkdir -p $(ROOT)/etc/init.d
#cp -af ./etc/init.d/* $(ROOT)/etc/init.d/
mkdir -p $(ROOT)/usr
cp -f ./usr/reinit_reason $(ROOT)/usr/
# shared library
mkdir -p $(ROOT)/$(base_libdir)
cp -f ./$(base_libdir)/lib$(NAME).so $(ROOT)/$(base_libdir)/
mkdir -p $(ROOT)/sbin
cp -rf ./sbin/* $(ROOT)/sbin/
# factory default configuration and translations
mkdir -p $(ROOT)/tmp
mkdir -p $(ROOT)/$(ETC_PATH)/sncfg
mkdir -p $(ROOT)/usr/cfg
-cp -rf ./usr/cfg/*.cfg $(ROOT)/usr/cfg/
mkdir -p $(ROOT)/sbin
cp -f ./sbin/rcenable $(ROOT)/sbin/
mkdir -p $(ROOT)/etc/rc.d
cd $(ROOT)/etc/rc.d && rm -f S00sncfgd && ln -sf ./$(bindir)/sncfgd S00sncfgd
cd $(ROOT)/etc/rc.d && rm -f S02sncfgd_sc_stage0 && ln -sf ./$(bindir)/sncfgd_sc_stage0 S02sncfgd_sc_stage0
cd $(ROOT)/etc/rc.d && rm -f S20sncfgd_sc_stage1 && ln -sf ./$(bindir)/sncfgd_sc_stage1 S20sncfgd_sc_stage1
# rootfs link.d event
mkdir -p $(ROOT)/sbin/link.d/wan
cp -f ./sbin/link.d/wan/* $(ROOT)/sbin/link.d/wan/S99wanlink
#Include headers
#mkdir -p $(ROOT)/include/
#cp -rf ./$(includedir)/* $(ROOT)/include/
_uninstall:
rm -f $(ROOT)/etc/init.d/sncfgd*
rm -f $(ROOT)/etc/rc.d/*sncfg*
rm -rf $(ROOT)/$(ETC_PATH)/sncfg
rm -f $(ROOT)/sbin/apinfo
rm -f $(ROOT)/sbin/rcenable
rm -f $(ROOT)/sbin/sncfgd
rm -f $(ROOT)/sbin/sncfg-restore.sh
rm -f $(ROOT)/sbin/link.d/wan/S99wanlink
rm -f $(ROOT)/usr/reinit_reason
clean:
rm -rf bin/ doc/ ./$(base_libdir) usr/ test/ ./$(base_sbindir) etc/ mnt/ tmp/