Bug 196947 - [NEW PORT] devel/py-python-pcre: Python PCRE Library
Summary: [NEW PORT] devel/py-python-pcre: Python PCRE Library
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Johannes Jost Meixner
URL:
Keywords: feature, needs-patch, needs-qa, patch
Depends on:
Blocks:
 
Reported: 2015-01-20 21:31 UTC by Maxim Filimonov
Modified: 2015-07-01 10:17 UTC (History)
2 users (show)

See Also:


Attachments
.shar for the port (1.17 KB, application/x-shar)
2015-01-20 21:31 UTC, Maxim Filimonov
no flags Details
.shar for the port: the final version (1.53 KB, patch)
2015-01-21 19:31 UTC, Maxim Filimonov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Filimonov 2015-01-20 21:31:21 UTC
Created attachment 151925 [details]
.shar for the port

Please add a new port. I uploaded it to github: https://github.com/part1zano/python-pcre-freebsd-port
I also uploaded the .shar here.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-21 01:30:12 UTC
Thanks for your submission Maxim. On initial review:

- PORTNAME must match upstream name (python-pcre)
- py- in PORTNAME should be removed, and PKGNAMEPREFIX=${PYTHON_PKGNAMEPREFIX} added instead
- python is missing as a second entry for CATEGORIES
- Add LICENSE_FILE is one exists in ${WRKSRC}
- GH_PROJECT defaults to ${PORTNAME} which wont be needed after the above PORTNAME change
- Sort USE_PYTHON values alphabetically
- MAINTAINER is in the wrong location
- WWW: entry is missing in pkg-descr (don't include a trailing slash)
- There are a number of other Makefile entry order issues (portlint will tell you)

Please also:

- Attach portlint -AC output (after addressing any outstanding issues)
- Attach successful poudriere build output. If you dont have poudriere, you can attach output of the following instead:

make stage && make check-plist && make stage-qa && make package

Bonus:

- Include (attach) python unit test output
- Create an issue upstream asking the author to upload the package to PyPi (under name python-pcre)
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-21 01:32:42 UTC
Also, the latest version reference I can see in the github repository is 0.5 (see setup.py). It's not considered good practice to set arbitrary PORTVERSION's.

Please ask the upstream author to tag the github repository with proper version tags, and update the PORTVERSION in your patch to reflect the correct current version, even if you *do* continue to fetch the sources via a commit has and not a version tag)
Comment 3 Maxim Filimonov 2015-01-21 12:15:40 UTC
> output of portlint -AC

Here it is:
% portlint -AC
FATAL: Makefile: [5]: use a tab (not space) after a variable name
FATAL: Makefile: [6]: use a tab (not space) after a variable name
FATAL: Makefile: [9]: use a tab (not space) after a variable name
FATAL: Makefile: [11]: use a tab (not space) after a variable name
FATAL: Makefile: [12]: use a tab (not space) after a variable name
FATAL: Makefile: [13]: use a tab (not space) after a variable name
FATAL: Makefile: [14]: use a tab (not space) after a variable name
FATAL: Makefile: [16]: use a tab (not space) after a variable name
FATAL: Makefile: [19]: use a tab (not space) after a variable name
WARN: Makefile: [17]: possible direct use of command "python" found. use ${PYTHON_CMD} instead.
WARN: Makefile: possible direct use of "CFLAGS          += -I/usr/local" found. if so, use ${PREFIX} or ${LOCALBASE}, as appropriate.
WARN: Makefile: PORTVERSION/DISTVERSION is set externally to this port's Makefile, but this port is not configured as a slave port.
WARN: Makefile: CATEGORIES is set externally to this port's Makefile, but this port is not configured as a slave port.
FATAL: Makefile: extra item "PORTVERSION        " placed in the MAINTAINER section.
FATAL: Makefile: extra item "CATEGORIES " placed in the MAINTAINER section.
FATAL: Makefile: extra item "LICENSE            " placed in the MAINTAINER section.
WARN: Makefile: MAINTAINER is set externally to this port's Makefile, but this port is not configured as a slave port.
FATAL: Makefile: COMMENT has to be there.
FATAL: Makefile: extra item "MAINTAINER " placed in the LICENSE section.
WARN: .git: dotfiles are not preferred. If this file is a dotfile to be installed as an example, consider importing it as "dot.git".
FATAL: .git/refs/tags: empty directory should be removed.
FATAL: .git/branches: empty directory should be removed.
FATAL: .git/objects/info: empty directory should be removed.
FATAL: work: be sure to cleanup the working directory before committing the port.
18 fatal errors and 6 warnings found.
Comment 4 Maxim Filimonov 2015-01-21 12:18:36 UTC
> output of the long make command

Here it is:

===>  License BSD3CLAUSE accepted by the user
===>   python-pcre-1.0 depends on file: /usr/local/sbin/pkg - found
=> python-pcre-1.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://codeload.github.com/awahlig/python-pcre/legacy.tar.gz/1efa30c?dummy=/python-pcre-1.0.tar.gz
python-pcre-1.0.tar.gz                                   0  B    0  Bps
===> Fetching all distfiles required by python-pcre-1.0 for building
===>  Extracting for python-pcre-1.0
=> SHA256 Checksum OK for python-pcre-1.0.tar.gz.
===>  Patching for python-pcre-1.0
===>   python-pcre-1.0 depends on package: py27-setuptools27>0 - found
===>   python-pcre-1.0 depends on file: /usr/local/bin/python2.7 - found
===>  Configuring for python-pcre-1.0
running config
===>  Building for python-pcre-1.0
running build
running build_py
creating build
creating build/lib.freebsd-10.1-RELEASE-amd64-2.7
copying python/pcre.py -> build/lib.freebsd-10.1-RELEASE-amd64-2.7
running build_ext
building '_pcre' extension
creating build/temp.freebsd-10.1-RELEASE-amd64-2.7
creating build/temp.freebsd-10.1-RELEASE-amd64-2.7/src
cc -DNDEBUG -O2 -pipe -I/usr/local/include -fstack-protector -fno-strict-aliasing -fPIC -I/usr/local/include/python2.7 -c src/pcremodule.c -o build/temp.freebsd-10.1-RELEASE-amd64-2.7/src/pcremodule.o -fno-strict-aliasing
src/pcremodule.c:1449:80: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
            || _config_get_ulong(dict, "match_limit", PCRE_CONFIG_MATCH_LIMIT) < 0
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
src/pcremodule.c:1450:100: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
            || _config_get_ulong(dict, "match_limit_recursion", PCRE_CONFIG_MATCH_LIMIT_RECURSION) < 0
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
2 warnings generated.
cc -shared -fstack-protector -O2 -pipe -I/usr/local/include -fstack-protector -fno-strict-aliasing build/temp.freebsd-10.1-RELEASE-amd64-2.7/src/pcremodule.o -L/usr/local/lib -lpcre -lpython2.7 -o build/lib.freebsd-10.1-RELEASE-amd64-2.7/_pcre.so
===>  Staging for python-pcre-1.0
===>   python-pcre-1.0 depends on package: pcre>=6.0 - found
===>   python-pcre-1.0 depends on package: py27-setuptools27>0 - found
===>   python-pcre-1.0 depends on file: /usr/local/bin/python2.7 - found
===>   Generating temporary packing list
running install
running build
running build_py
running build_ext
running install_lib
creating /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7
creating /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7/site-packages
copying build/lib.freebsd-10.1-RELEASE-amd64-2.7/pcre.py -> /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7/site-packages
copying build/lib.freebsd-10.1-RELEASE-amd64-2.7/_pcre.so -> /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7/site-packages
byte-compiling /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7/site-packages/pcre.py to pcre.pyc
writing byte-compilation script '/tmp/tmp7kwehL.py'
/usr/local/bin/python2.7 -O /tmp/tmp7kwehL.py
removing /tmp/tmp7kwehL.py
running install_egg_info
running egg_info
creating python/python_pcre.egg-info
writing python/python_pcre.egg-info/PKG-INFO
writing top-level names to python/python_pcre.egg-info/top_level.txt
writing dependency_links to python/python_pcre.egg-info/dependency_links.txt
writing manifest file 'python/python_pcre.egg-info/SOURCES.txt'
reading manifest file 'python/python_pcre.egg-info/SOURCES.txt'
writing manifest file 'python/python_pcre.egg-info/SOURCES.txt'
Copying python/python_pcre.egg-info to /home/che/git/python-pcre-freebsd-port/work/stage/usr/local/lib/python2.7/site-packages/python_pcre-0.5-py2.7.egg-info
running install_scripts
writing list of installed files to '/home/che/git/python-pcre-freebsd-port/work/.PLIST.pymodtmp'
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Warning: 'lib/python2.7/site-packages/_pcre.so' is not stripped consider trying INSTALL_TARGET=install-strip or using ${STRIP_CMD}
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
===> No pkg-plist issues found (check-plist)
====> Running Q/A tests (stage-qa)
Warning: 'lib/python2.7/site-packages/_pcre.so' is not stripped consider trying INSTALL_TARGET=install-strip or using ${STRIP_CMD}
===>  Building package for python-pcre-1.0
Comment 5 Maxim Filimonov 2015-01-21 12:20:19 UTC
And yeah, most of the notices fixed in github. Do I have to upload the updated .shar here?
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2015-01-21 12:42:36 UTC
Before you update the shar, you'll want to first:

- Fix the issues identified by portlint
- Fix the warnings identified by the long make command

Also:

- Feel free to attach an svn diff instead of a shell archive (shar)
- Please include long files or outputs *as attachments*, instead of pasting them into comments

The FreeBSD Python team is available on freenode IRC at #freebsd-python if you would like additional guidance or assistance getting your submission ready to commit.

Thanks!
Comment 7 Maxim Filimonov 2015-01-21 19:31:30 UTC
Created attachment 151986 [details]
.shar for the port: the final version
Comment 8 Johannes Jost Meixner freebsd_committer 2015-01-21 19:32:40 UTC
I'll take it.
Comment 9 commit-hook freebsd_committer 2015-07-01 08:08:44 UTC
A commit references this bug:

Author: xmj
Date: Wed Jul  1 08:07:51 UTC 2015
New revision: 391035
URL: https://svnweb.freebsd.org/changeset/ports/391035

Log:
  devel/py-python-pcre: add port.

  A Python PCRE library

  WWW: https://github.com/awahlig/python-pcre

  PR:		196947
  Differential Revision:	https://reviews.freebsd.org/D1596
  Submitted by:	Maxim Filimonov <che@bein.link>
  Reviewed by: koobs, swills (while still in mentorship)

Changes:
  head/devel/Makefile
  head/devel/py-python-pcre/
  head/devel/py-python-pcre/Makefile
  head/devel/py-python-pcre/distinfo
  head/devel/py-python-pcre/files/
  head/devel/py-python-pcre/files/patch-setup.py
  head/devel/py-python-pcre/pkg-descr
Comment 10 Johannes Jost Meixner freebsd_committer 2015-07-01 10:17:26 UTC
Committed, thanks!