+endef
+
+define Package/ipkg/preinst
+ if [ -L $${IPKG_INSTROOT}/usr/bin/ipkg ] ; then
+ echo -e "Removing busybox ipkg symlink"
+ rm $${IPKG_INSTROOT}/usr/bin/ipkg
+ fi
+endef
+
+define Package/ipkg/postrm
+ if [ "$(busybox ipkg 2>&1)" != "busybox: applet not found" ] ; then
+ echo -e "Reinstalling busybox ipkg symlink"
+ ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/ipkg
+ fi
+endef
+
+define Package/ipkg/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipkg-cl $(1)/usr/bin/ipkg
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipkg.so.* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+ mkdir -p $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/libipkg $(1)/usr/include/
+endef