-$(PKG_IPK): $(PKG_BUILD_DIR)/.built
- $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) libncurses.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
- mkdir -p $(PKG_IPK_DIR)/usr/lib
- cp -a $(PKG_BUILD_DIR)/lib/lib*.so.* $(PKG_IPK_DIR)/usr/lib/
- mkdir -p $(PKG_IPK_DIR)/usr/share/terminfo
+$(IPKG_LIBNCURSES): $(STAGING_DIR)/usr/lib/libncurses.so
+ $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBNCURSES) ./ipkg/lib$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
+ mkdir -p $(IDIR_LIBNCURSES)/usr/lib
+ cp -fpR $(STAGING_DIR)/usr/lib/lib{ncurses,panel}*.so.* $(IDIR_LIBNCURSES)/usr/lib/
+ $(STRIP) $(IDIR_LIBNCURSES)/usr/lib/*.so*
+ mkdir -p $(IDIR_LIBNCURSES)/usr/share/terminfo