- rm -f $(IDIR_CUPS)/usr/lib/*.a
- rm -f $(IDIR_CUPS)/usr/share/doc/cups/* || true
- rm -rf $(IDIR_CUPS)/usr/share/doc/cups/??
- rm -rf $(IDIR_CUPS)/usr/share/locale
- rm -rf $(IDIR_CUPS)/usr/share/cups/banners
- rm -rf $(IDIR_CUPS)/usr/share/cups/charsets
- rm -rf $(IDIR_CUPS)/usr/share/cups/fonts
- rm -rf $(IDIR_CUPS)/usr/share/cups/model
- rm -rf $(IDIR_CUPS)/usr/share/cups/data
- rm -rf $(IDIR_CUPS)/usr/share/cups/templates/??
- rm -rf $(IDIR_CUPS)/usr/include
- rm -rf $(IDIR_CUPS)/var
- rm -rf $(IDIR_CUPS)/etc/*.d
- $(STRIP) $(IDIR_CUPS)/usr/bin/*
- $(STRIP) $(IDIR_CUPS)/usr/lib/cups/backend/*
- $(STRIP) $(IDIR_CUPS)/usr/lib/cups/cgi-bin/*
- $(STRIP) $(IDIR_CUPS)/usr/lib/cups/daemon/*
- cp -a ./files/* $(IDIR_CUPS)/
+ install -d -m0755 $(IDIR_CUPS)/usr/lib
+ cp -fp $(PKG_INSTALL_DIR)/usr/lib/libcups.so.* $(IDIR_CUPS)/usr/lib/
+ cp -fpR $(PKG_INSTALL_DIR)/usr/lib/cups $(IDIR_CUPS)/usr/lib/
+ install -d -m0755 $(IDIR_CUPS)/usr/share/cups/templates
+ cp -fp $(PKG_INSTALL_DIR)/usr/share/cups/templates/*.tmpl $(IDIR_CUPS)/usr/share/cups/templates/
+ install -d -m0755 $(IDIR_CUPS)/usr/share/doc/cups
+ cp -fp $(PKG_INSTALL_DIR)/usr/share/doc/cups/index.html $(IDIR_CUPS)/usr/share/doc/cups/
+ cp -fpR $(PKG_INSTALL_DIR)/usr/share/doc/cups/images $(IDIR_CUPS)/usr/share/doc/cups/
+ install -d -m0755 $(IDIR_CUPS)/usr/sbin
+ cp -fp $(PKG_INSTALL_DIR)/usr/sbin/* $(IDIR_CUPS)/usr/sbin/
+ # overwrite default config with our own
+ cp -fpR ./files/etc/cups/* $(IDIR_CUPS)/etc/cups/
+ # install initscript with priority 60
+ install -d -m0755 $(IDIR_CUPS)/etc/init.d
+ install -m0755 ./files/cupsd.init $(IDIR_CUPS)/etc/init.d/S60cupsd