On 2018/04/18 18:10, LÉVAI Dániel wrote:
> Hi!
> 
> Update to kc, that breaks compatibility with <2.4 kc databases.
> Please check how I handled it here, I tried to mimic postgresql's way
> with @ask-update.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/security/kc/Makefile,v
> retrieving revision 1.14
> diff -u -p -p -u -r1.14 Makefile
> --- Makefile  29 Dec 2015 19:49:41 -0000      1.14
> +++ Makefile  18 Apr 2018 16:06:29 -0000
> @@ -4,8 +4,7 @@ COMMENT =     console based password storing
>  
>  GH_ACCOUNT = levaidaniel
>  GH_PROJECT = kc
> -GH_TAGNAME = 2.3.2
> -REVISION =   1
> +GH_TAGNAME = 2.4.1

Since you're upstream would you mind uploading a tar.gz as a
"release asset" and switching to that please? There's a drag-and-drop
or file selection box on the releases page (or there are some gists
floating around if you want to automate it).

That way we aren't at risk of broken auto-generated distfiles
when github update their software stack.

Ports-wise that involves traditional DISTNAME and MASTER_SITES lines
instead of GH_*.

>  CATEGORIES = security
>  
> @@ -21,10 +20,21 @@ WANTLIB += c crypto edit ncursesw pcre p
>  LIB_DEPENDS =        textproc/libxml \
>               devel/pcre
>  
> -MAKE_ENV +=  HAVE_PCRE=yes
> +MAKE_ENV +=  HAVE_PCRE=yes OS_OPENBSD=yes
> +
> +FLAVORS =    scrypt
> +FLAVOR ?=
> +
> +.if ${FLAVOR:Mscrypt}
> +LIB_DEPENDS +=       security/libscrypt
> +MAKE_ENV +=  HAVE_LIBSCRYPT=yes
> +.endif
> +

It's only a small dep, is there a real advantage to making it optional?

If there is, please mention the flavour in DESCR, otherwise I'd prefer to
have it rolled into a single package.

LIB_DEPENDS with no matching WANTLIB entry is not valid, it will be
stripped by pkg_create with a warning message.

If it's actually static linked then you can *either* list as
BUILD_DEPENDS, *or* list as LIB_DEPENDS + WANTLIB with a comment next
to WANTLIB about it being static linked. I prefer the latter because
there's a higher chance of your port getting updated when that library
is updated. Otherwise you're dependent on manual REVISION bumps to
trigger updates.

>  post-install:
>       ${INSTALL_DATA_DIR} ${PREFIX}/share/kc
>       ${INSTALL} ${WRKBUILD}/pwsafe_to_kc.pl ${PREFIX}/share/kc/
> +     ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/kc
> +     ${INSTALL} ${WRKBUILD}/Changelog ${PREFIX}/share/doc/kc/
>  
>  .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/security/kc/distinfo,v
> retrieving revision 1.5
> diff -u -p -p -u -r1.5 distinfo
> --- distinfo  24 Dec 2013 12:56:19 -0000      1.5
> +++ distinfo  18 Apr 2018 16:06:29 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (kc-2.3.2.tar.gz) = 1Ap74wB55M/EI+GqK127Dm8LNInx0OCQzWZyi8Mo/Ng=
> -SIZE (kc-2.3.2.tar.gz) = 44779
> +SHA256 (kc-2.4.1.tar.gz) = /+rP1koXzdF1nXsXkwl7CwA9J15klgyYKCepxf2W6Nk=
> +SIZE (kc-2.4.1.tar.gz) = 75169
> Index: patches/patch-Changelog
> ===================================================================
> RCS file: patches/patch-Changelog
> diff -N patches/patch-Changelog
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-Changelog   18 Apr 2018 16:06:29 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: Changelog
> +--- Changelog.orig
> ++++ Changelog
> +@@ -43,7 +43,7 @@ Creating '/home/user/.kc/default.kcd'
> + Using '/home/user/.kc/default.kcd' database.
> + New password (empty to cancel):
> + New password again (empty to cancel):
> +-<default% > importxml kcdump.xml
> ++<default% > importxml -k kcdump.xml
> + Import OK
> + <example_chain% > write
> + Save OK
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/security/kc/pkg/PLIST,v
> retrieving revision 1.3
> diff -u -p -p -u -r1.3 PLIST
> --- pkg/PLIST 21 Mar 2013 09:48:45 -0000      1.3
> +++ pkg/PLIST 18 Apr 2018 16:06:29 -0000
> @@ -1,6 +1,9 @@
>  @comment $OpenBSD: PLIST,v 1.3 2013/03/21 09:48:45 jasper Exp $
> +@ask-update kc-<2.4 Make sure all your existing kc databases are safely 
> *dumped* ('dump' command) then read the Changelog in ${PREFIX}/share/doc/kc 
> after installation
>  @bin bin/kc
>  @man man/man1/kc.1
> +share/doc/kc/
> +share/doc/kc/Changelog
>  share/doc/pkg-readmes/${FULLPKGNAME}
>  share/kc/
>  share/kc/pwsafe_to_kc.pl
> 
> 
> 
> -- 
> LÉVAI Dániel
> PGP key ID = 0x83B63A8F
> Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F
> 

Reply via email to