Writing a port make deinstall

Kubilay Kocak koobs at FreeBSD.org
Wed Jul 12 02:47:43 UTC 2017


On 7/12/17 12:38 PM, blubee blubeeme wrote:
> Hello FreeBSD ports team
> 
> I am writing a Makefile to install a port
> 
> I've written this much so far
> 
> PORTNAME=       epson-inkjet-printer-201401w
> PORTVERSION=   201401w
> PORTREVISION=   1
> PORTEPOCH=       0
> CATEGORIES=       print
> MASTER_SITES=
> https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/d95c03482376873661d7a8d4c165b385cd082cf3/:amd64
> \
> 
> https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/0c527f1eef727e350302db951a45d31319ee501b/:i386
> 
> DISTFILES_amd64=
> epson-inkjet-printer-201401w-1.0.0-1lsb3.2.x86_64.rpm:amd64
> DISTFILES_i386=    epson-inkjet-printer-201401w-1.0.0-1lsb3.2.i486.rpm:i386
> 
> 
> LICENSE=       GPLv2
> DIST_SUBDIR=   ${PORTNAME}/${PORTVERSION}
> 
> COMMENT=       CUPS filter for Seiko Epson Color Ink Jet Printers
> 
> RESTRICTED=       GNU Lesser General Public License version 2.1. \
>                    This program links the following object codes  \
>       which are distributed under the conditions of  \
>           SEIKO EPSON CORPORATION SOFTWARE LICENSE AGREEMENT. \
>           *libEpson_201401w.so.1.0.0 \
>           *libEpson_201401w.MT.so.1.0.0
> 
> 
> NO_BUILD=       yes
> NO_WRKSUBDIR=   yes
> PLIST_SUB=       LINUXBASE=${LINUXBASE}
> USES=       linux
> USE_LINUX=       cups-libs jpeg
> 
> do-install:
> (gunzip ${WRKSRC}/opt/${PORTNAME}/ppds/Epson/*)
> (find ${WRKSRC}/opt/${PORTNAME}/ppds/Epson -type f -exec sed -i ""
> 's/\/opt\/epson/\/compat\/linux\/opt\/epson/g' {} \;)
> (cp -r ${WRKSRC}/opt/${PORTNAME} /compat/linux/opt/)
> (ln -s /compat/linux/opt/${PORTNAME}/ppds/Epson
> /usr/local/share/cups/model/)
> 
> #cleanup?
> # rm -r /usr/local/share/cups/model/Epson
> # rm -r /compat/linux/opt/epson-inkjet-printer-201401w/
> # rm -r ${WRKSRC}
> .include <bsd.port.mk>
> 
> 
> I don't know how to make the cleanup work.
> 
> This Makefile passes works for installing the drivers and they work but
> doing
> 
> make deinstall clean
> 
> doesn't remove the files that I placed, the symlinks, etc.
> 
> How do I properly write this Makefile so deinstall works as expected?
> 
> Best,
> Owen

Hi Owen,

deinstall automatically works if and when all files/directories are
correctly referenced in the pkg-plist. Writing a deinstallation
procedure manually is not necessary.

Porters Handbook:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#porting-desc

See Also: PLIST_FILES and other pkg-plist related entries

Testing the port with poudriere and other tools will help you determine
what is not working, in particular which files were installed but not
referenced in the pkg-plist, and vice-versa.

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/testing.html

For more help, there's also the #freebsd-ports IRC channel on freenode

Hope that helps :)

./koobs





More information about the freebsd-ports mailing list