Bug 206987

Summary: [NEW PORT] security/akmos: Cryptographic library with low footprint
Product: Ports & Packages Reporter: Andrew Romanenko <melanhit>
Component: Individual Port(s)Assignee: Raphael Kubo da Costa <rakuco>
Status: Closed FIXED    
Severity: Affects Some People CC: rakuco
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
akmos.shar
rakuco: maintainer-approval+
akmos.shar [fixed]
rakuco: maintainer-approval+
akmos.shar [GH_PROJECT fixed]
none
new release 0.5
none
9.3-i386 error log
none
akmos.shar [fixed] none

Description Andrew Romanenko 2016-02-06 21:57:19 UTC
Created attachment 166674 [details]
akmos.shar
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-03-05 00:15:49 UTC
Thanks for the patch. A few suggestions:
- It looks like your .shar got included in the .shar itself.
- You can replace the bsd.options.mk include and the options checks with helpers:
  ASM_CMAKE_ON=   -DAKMOS_ENABLE_ASM=ON
  ASM_CMAKE_OFF=  -DAKMOS_ENABLE_ASM=OFF
  etc etc
Comment 2 Andrew Romanenko 2016-03-07 19:53:43 UTC
Created attachment 167820 [details]
akmos.shar [fixed]
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-03-09 10:10:14 UTC
> GH_PROJECT=	${PORTNAME:S/2$//}
There's no 2 in PORTNAME, do you really need to set GH_PROJECT at all?
Comment 4 Andrew Romanenko 2016-03-09 21:15:48 UTC
Created attachment 167939 [details]
akmos.shar [GH_PROJECT fixed]
Comment 5 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-03-10 15:37:04 UTC
Please run `portlint -AC' on your patches to uncover problems like these:

> WARN: pkg-plist: [4]: installing shared libraries, please define USE_LDCONFIG as appropriate
> WARN: pkg-plist: [5]: installing shared libraries, please define USE_LDCONFIG as appropriate
> WARN: pkg-plist: [8]: empty line found in plist.
> WARN: pkg-plist: seems to have unnecessary blank lines at the last part.

With that said, the port fails to build on 9.3:

[  2%] Building C object src/CMakeFiles/akmos_obj.dir/akmos.c.o
cd /wrkdirs/usr/ports/security/akmos/work/.build/src && /usr/bin/cc  -DAKMOS_BUFSZ=8192 -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=500 -I/wrkdirs/usr/ports/security/akmos/work/akmos-0.4/src -O2 -pipe -fno-strict-aliasing -O2 -DNDEBUG   -fPIC -DPIC -ansi -Wall -Werror -Wmissing-prototypes -o CMakeFiles/akmos_obj.dir/akmos.c.o   -c /wrkdirs/usr/ports/security/akmos/work/akmos-0.4/src/akmos.c
cc1: warnings being treated as errors
In file included from /wrkdirs/usr/ports/security/akmos/work/akmos-0.4/src/akmos.c:36:
/wrkdirs/usr/ports/security/akmos/work/akmos-0.4/src/cipher.h:90: warning: declaration does not declare anything

The struct was removed in upstream commit 
43a8f262bad7883649acf98937304998b230e625. Since you seem to be the upstream maintainer as well, there are a few things you can do:
- Import that commit as a patch to the port if it works fine without the others before it.
- Make a new release that includes that commit if the code is stable.
- Add "CFLAGS+= -fms-extensions" for this version of the port.
- Require a newer compiler with USES=compiler:c11, but that may be overkill.
Comment 6 Andrew Romanenko 2016-03-17 22:21:42 UTC
Created attachment 168337 [details]
new release 0.5

created new release, fixed previous errors (i hope)
Comment 7 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-03-18 17:05:18 UTC
Created attachment 168370 [details]
9.3-i386 error log

The 9.3-i386 build is still broken: the code is built with -Werror and there are lots of warnings related to the use of some numeric constants that GCC 4.2 does not think are right.

If you're sure of what's being done there, you can just force the use of a newer compiler with USES=compiler:c11.
Comment 8 Andrew Romanenko 2016-03-24 01:21:18 UTC
Created attachment 168556 [details]
akmos.shar [fixed]
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-03-24 11:01:24 UTC
A commit references this bug:

Author: rakuco
Date: Thu Mar 24 11:01:19 UTC 2016
New revision: 411770
URL: https://svnweb.freebsd.org/changeset/ports/411770

Log:
  New port: security/akmos.

  Akmos is a cryptographic library with CLI.

  It supports:
  - symmetric ciphering;
  - computing message digests (hashes);
  - calculating a message authentication code (MAC);

  Depends only on the standard C library.
  Primary develop for the x86_64 architecture.

  WWW: https://github.com/melanhit/akmos

  PR:		206987
  Submitted by:	Andrew Romanenko <melanhit@gmail.com>

Changes:
  head/security/Makefile
  head/security/akmos/
  head/security/akmos/Makefile
  head/security/akmos/distinfo
  head/security/akmos/pkg-descr
  head/security/akmos/pkg-plist
Comment 10 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-03-24 11:02:19 UTC
Finally landed, thanks a lot!