[OpenWrt-Devel] [package] shadow: unresolvable dependency with shadow-utils

Gergely Kiss mail.gery at gmail.com
Sun Dec 14 12:34:16 EST 2014


Hi Steven,

my name is Gergely Kiss, I have recently started creating patches for openwrt and I'm about to publish some packages to the packages repository (some ported from oldpackages, others are brand new).

However, one of the packages depends on shadow-useradd and this dependency seems to be unresolvable by opkg for some reason:

root at OpenWrt:~# opkg install seafile-server
Installing seafile-server (3.1.7-1) to root...
Downloading file:///tmp/packages/seafile-server_3.1.7-1_ar71xx.ipk.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for seafile-server:
 * 	shadow-utils * 
 * opkg_install_cmd: Cannot install package seafile-server.

As far as I can understand, shadow-utils is a pseudo-package only, it's install section is empty and therefore the package file is not generated, hence the dependency cannot be satisfied by opkg.

This section from the package Makefile looks interesting to me:

define Package/shadow-utils/config
    menu "Select shadow utilities"
      depends on PACKAGE_shadow-utils

I think here you make all shadow-* packages depending on the non-existing shadow-utils package, at least that's what I can see in menuconfig:

Symbol: PACKAGE_shadow-useradd [=m]
[...]
Type  : tristate
Prompt: Full PLD version of useradd utility
Defined at tmp/.config-package.in:53096
*** Depends on: PACKAGE_shadow-utils [=m] ***

Could you please check if this is a bug indeed?

Here's my package's Makefile:

*****************************************************
#
# Copyright (C) 2007-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=seafile-server
PKG_VERSION:=3.1.7
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0

PKG_BUILD_DIR:=$(BUILD_DIR)/seafile-$(PKG_VERSION)-server
PKG_SOURCE:=v$(PKG_VERSION)-server.tar.gz
PKG_SOURCE_URL:=https://github.com/haiwen/seafile/archive/
PKG_MD5SUM:=af35324998b6c98fe1442d5d775871ee
PKG_CAT:=zcat
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

define Package/seafile-server
    SECTION:=net
    CATEGORY:=Network
    TITLE:=Seafile server
    MAINTAINER:=Gergely Kiss <mail.gery at gmail.com>
    URL:=http://seafile.com/
    DEPENDS:=+shadow-useradd +libarchive +libopenssl +glib2 +seafile-ccnet +libsearpc +sqlite3-cli +python-mysql \
		+jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient +libevhtp \
		+libpthread +libuuid +seafile-seahub +bash +sudo +procps +procps-pkill $(ICONV_DEPENDS)
endef

define Package/seafile-server/description
   Open source cloud storage with advanced features on privacy protection and teamwork.
endef

CONFIGURE_ARGS += --disable-riak \
		    --disable-client \
		    --disable-fuse \
		    --enable-server \
		    --enable-python \
		    --disable-static-build \
		    --disable-server-pkg \
		    --disable-console

PKG_BUILD_DEPENDS:=vala/host \
		    libsearpc/host

TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
		    -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz

Hooks/Prepare/Post += delete_source_package

define delete_source_package
	# deleting downloaded source package as its filename is ambiguous
	rm -f $(DL_DIR)/$(PKG_SOURCE)
endef

define Package/seafile-server/install
	$(INSTALL_DIR) $(1)/usr/{bin,lib}
	$(INSTALL_DIR) $(1)/usr/lib/python2.7/site-packages
	$(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server/runtime
	$(INSTALL_DIR) $(1)/etc/init.d
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/seafile/ $(1)/usr/lib/python2.7/site-packages/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/seaserv/ $(1)/usr/lib/python2.7/site-packages/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
	$(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
	$(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
	$(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
	$(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
	$(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
	$(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
	$(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
endef

define Package/seafile-server/postinst
#!/bin/sh

if ! id -u seafile >/dev/null 2>&1; then
    useradd seafile -d "/usr/share/seafile" -s /bin/sh; fi

chown -R seafile:seafile /usr/share/seafile/
chmod -R o-rwx /usr/share/seafile/

if [ ! -d "/usr/share/seafile/seafile-data" ]
then
   echo "*** Installation completed, running configuration script..."
   /etc/init.d/seafile setup

   if [ $$? -ne 0 ]
   then
      echo
      echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
      echo "*** \"/etc/init.d/seafile setup\""
   fi
echo
echo "*** NOTE: you need to create an admin account before using Seafile."
echo "*** Please run \"/etc/init.d/seafile create_admin\" to do so."
fi

/etc/init.d/seafile enable
/etc/init.d/seafile restart
endef

define Package/seafile-server/prerm
#!/bin/sh
/etc/init.d/seafile stop
endef

$(eval $(call BuildPackage,seafile-server))

*****************************************************


Kind Regards,
Gergely
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list