# new port: sysutils/itdb - help needed for errors at pkg_add && pkg_deinstall



## da1 (May 16, 2013)

Hi guys,

I wrote a new port but have problems at steps 4 and 5. The problem is that when I `make deinstall`, for some reason, I get errors that some directories could not be removed, when in reality they were never created in the first place. 

The Makefile:

```
# $FreeBSD$

PORTNAME=	itdb
DISTVERSION=	1.8
CATEGORIES=	sysutils
MASTER_SITES=	http://www.sivann.gr/software/itdb/

MAINTAINER=	claudiu.vasadi@gmail.com
COMMENT=	A web based asset inventory management tool

RUN_DEPENDS=	${LOCALBASE}/lib/php/${PHP_EXT_DIR}/pdo_sqlite.so:${PORTSDIR}/databases/php5-pdo_sqlite

USE_GZ=		yes
USE_APACHE_RUN=	22+
USE_PHP=	yes
USE_SQLITE=	yes
NO_BUILD=	yes

do-install:
	${MKDIR} ${WWWDIR}
	${CP} -r ${WRKDIR}/${PORTNAME}/* ${WWWDIR}/

.include <bsd.port.mk>
```

distinfo:

```
SHA256 (itdb-1.8.tar.gz) = 5da634e2d755b2978fcd36d9e2c4b332cb8f799c15411ebc915a0b3e916bd57c
SIZE (itdb-1.8.tar.gz) = 15304608
```

The error:

```
===>  Deinstalling for sysutils/itdb
===>   Deinstalling itdb-1.8
pkg_delete: file '/usr/local/www/itdb/data/files' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/www/itdb/data/files'
pkg_delete: couldn't entirely delete package `itdb-1.8'
(perhaps the packing list is incorrectly specified?)
```

The reality:

```
[cmd]ls -la /usr/local/www/itdb[/cmd]
ls: /usr/local/www/itdb: No such file or directory
```

Relevant section of pkg-plist:

```
@dirrm www/itdb/data/files
@dirrm www/itdb/data
```

For some reason /usr/local/www/itdb/data/files does not get created upon pkg_create. Running `pkg_add` with the -v flag reveals no attempt in creating that directory. I think there is either a problem at creating the package or a problem at adding the package. 

My bets are for the first possibility but how can I track this down?


----------



## bkouhi (May 16, 2013)

Sorry, I don't know your answer, but I have two suggestions:

1. It's better to change:


```
USE_PHP=     yes
RUN_DEPENDS=	${LOCALBASE}/lib/php/${PHP_EXT_DIR}/pdo_sqlite.so:${PORTSDIR}/databases/php5-pdo_sqlite
```

To:


```
USE_PHP=     pdo_sqlite
```

2. Please don't use ${CP} for installing a whole directory tree. Use ${COPYTREE_SHARE} instead.


```
do-install:
        ${MKDIR} ${WWWDIR}
        cd ${WRKDIR}/${PORTNAME}/ && ${COPYTREE_SHARE} . ${WWWDIR}/
```


----------



## da1 (May 16, 2013)

Hi,

Good advice. Highly appreciated. 

The updated Makefile:

```
# $FreeBSD$

PORTNAME=	itdb
DISTVERSION=	1.8
CATEGORIES=	sysutils
MASTER_SITES=	http://www.sivann.gr/software/itdb/

MAINTAINER=	claudiu.vasadi@gmail.com
COMMENT=	A web based asset inventory management tool

USE_GZ=		yes
USE_APACHE_RUN=	22+
USE_PHP=	pdo_sqlite
USE_SQLITE=	yes
NO_BUILD=	yes

do-install:
	${MKDIR} ${WWWDIR}
	cd ${WRKDIR}/${PORTNAME}/ && ${COPYTREE_SHARE} . ${WWWDIR}/

.include <bsd.port.mk>
```


----------



## da1 (May 16, 2013)

This is the error I now get when issuing make deinstall (step 3):


```
===>  Deinstalling for sysutils/itdb
===>   Deinstalling itdb-1.8
pkg_delete: file '/usr/local/www/itdb/php/images/add.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/ajaxload.gif' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/b2wgrad.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/back_disabled.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/back_enabled.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/backup.gif' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bgpixels.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/add2.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/company.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/contract.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/database_blue.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/dbdown24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/document.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/down.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/exit24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/files.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/files128.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/floppy24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/hardware.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/labels.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/location.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/pie.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/plus.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/plus24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/rack1.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/search.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/search2.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/search24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/settings.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/software.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/spreadsheet24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/tag.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/tools.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/users.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/utilities24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/view_tree.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/big/wheel24.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bluebg-rev.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bluebg.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bluegrad.gif' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bluepsbg.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/bluepsbg.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/calendar.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/collection.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/collection_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/copy.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/copy_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/csv.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/csv_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/cvbutton.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/database_save.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/date.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/delete.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/detach.gif' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/down.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/down_bl.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/edit.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/editid.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/eye.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/favicon.ico' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/favicon.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/forward_disabled.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/forward_enabled.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/getdb2.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/grad-orange.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/grad2.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/info.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/infosmall.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/itdb.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/itdb1.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/itdb1_sm.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/itdb1_sm_glow.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/key.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/labelinfo.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/lightblbg.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/logout.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/logout_red.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/more.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/ntbg.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/pdf.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/pdf_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/pdficon.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/pencil.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/print.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/print_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/rackwheel.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/refresh.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/save.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/search.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/sort_asc.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/sort_asc_disabled.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/sort_both.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/sort_desc.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/sort_desc_disabled.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/table_edit.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/ttools_background.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/upload.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/view.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/warning.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/xcel2.jpg' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/xgray.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/xls.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/xls_hover.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/php/images/xred.png' doesn't exist
pkg_delete: file '/usr/local/www/itdb/images/big' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/www/itdb/images/big'
pkg_delete: couldn't entirely delete package `itdb-1.8'
(perhaps the packing list is incorrectly specified?)
```

Please keep in mind that after I modified the Makefile I regenerated the pkg-plist.


----------



## da1 (May 16, 2013)

FIXED by adjusting the pkg-plist file. 

Original error still stands.

LE: Attached, the said pkg-plist file.


----------

