On 2018/12/14 16:43, Renaud Allard wrote:
> 
> 
> On 12/14/18 4:38 PM, Renaud Allard wrote:
> > 
> > 
> > On 12/14/18 3:52 PM, Landry Breuil wrote:
> > > 
> > > cp -r /usr/obj/ports/traccar-4.2/tracker-server.jar
> > > /usr/obj/ports/traccar-4.2/fake-amd64/usr/local/share/traccar/
> > > /usr/obj/ports/traccar-4.2/bin/install -d -m 755 /etc/traccar
> > > install: /etc/traccar: Permission denied
> > > 
> > > not yet..  as other ports, use @sample for the dir and the file..
> > > 
> > 
> > I tried to reproduce this error, but I got no luck in doing it. Fully
> > new and freshly installed -current machine with a freshly downloaded
> > ports.tar.gz and pkg_add unzip javaPathHelper jre.
> > Can you tell me how you got this error?
> > 
> 
> Does a trailing / helps?

Here's a slightly cleaned up one. Comments inline, new tar.gz attached.

: diff --git Makefile Makefile
: index 6d667e3..d598d3b 100644
: --- Makefile
: +++ Makefile
: @@ -1,15 +1,13 @@
:  # $OpenBSD: Makefile,v 1.23 2018/12/13 12:46:19 renaud Exp $
:  
: -COMMENT =    Modern GPS Tracking Platform
: -
: +COMMENT =    modern GPS tracking platform

ports standard is to lowercase unless proper nouns.

:  V =          4.2
: -DISTNAME =   traccar-${V}
: +PKGNAME =    traccar-${V}
: +DISTNAME =   traccar-other-${V}
:  EXTRACT_SUFX =       .zip
: -DISTFILES =  traccar-other-${V}${EXTRACT_SUFX}
:  WRKDIST =    ${WRKDIR}

tidy

: -REVISION =   0

start with no REVISION
 
: -CATEGORIES = net
: +CATEGORIES = geo

this category is a better fit (net could maybe be added as a secondary
category)

:  HOMEPAGE =   https://www.traccar.org/
:  
:  MAINTAINER = Renaud Allard <[email protected]>
: @@ -28,17 +26,13 @@ RUN_DEPENDS=              java/javaPathHelper
:  NO_BUILD =              Yes
:  NO_TEST =               Yes
:  
: +do-configure:
: +     ${SUBST_CMD} ${WRKSRC}/conf/{default,traccar}.xml
: +

don't hardcode /usr/local

: 
:  do-install:
:       ${INSTALL_DATA_DIR} ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/conf ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/lib ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/schema ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/templates ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/web ${PREFIX}/share/traccar/
: -     cp -r ${WRKSRC}/tracker-server.jar ${PREFIX}/share/traccar/
: -     ${INSTALL_DATA_DIR} ${SYSCONFDIR}/traccar/

${SYSCONFDIR} isn't under ${PREFIX} so doesn't make it into the package.
it has to be copied at install time by pkg_add via the @sample mechanism.

: -     cp ${WRKSRC}/conf/default.xml ${SYSCONFDIR}/traccar
: -     ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/traccar/
: -     cp ${WRKSRC}/conf/traccar.xml ${PREFIX}/share/examples/traccar/
: +     cd ${WRKSRC}; cp -r conf lib schema templates web tracker-server.jar \
: +         ${PREFIX}/share/traccar/
: +     rm ${PREFIX}/share/traccar/conf/{default,traccar}.xml.*

simplify, remove .orig files etc to stop update-plist complaining,
no need for share/examples/ as the files are already copied to
share/traccar/ so can be @sample'd from there

:  
:  .include <bsd.port.mk>
: diff --git patches/patch-conf-default_xml patches/patch-conf_default_xml
: similarity index 77%
: rename from patches/patch-conf-default_xml
: rename to patches/patch-conf_default_xml

patches should be generated by copying the file with a .orig extension
and editing, then "make update-patches", which uses a standard filename
format and adds the $OpenBSD$ tag (that gets replaced automatically with
the full tag including committer account name etc by cvs when committing).

: index 9930144..c9633be 100644
: --- patches/patch-conf-default_xml
: +++ patches/patch-conf_default_xml
: @@ -1,11 +1,14 @@
: ---- conf/default.xml.orig    Fri Dec 14 08:26:52 2018
: -+++ conf/default.xml Fri Dec 14 08:27:51 2018
: +$OpenBSD$
: +
: +Index: conf/default.xml
: +--- conf/default.xml.orig
: ++++ conf/default.xml
:  @@ -12,7 +12,7 @@
:   
:       <entry key='web.enable'>true</entry>
:       <entry key='web.port'>8082</entry>
:  -    <entry key='web.path'>./web</entry>
: -+    <entry key='web.path'>/usr/local/share/traccar/web</entry>
: ++    <entry key='web.path'>${LOCALBASE}/share/traccar/web</entry>

as above, don't hardcode

:       <entry key='web.cacheControl'>max-age=3600,public</entry>
:   
:       <entry key='geocoder.enable'>false</entry>
: @@ -23,7 +26,7 @@
:       <entry key='processing.engineHours.enable'>true</entry>
:   
:  -    <entry key='media.path'>./media</entry>
: -+    <entry key='media.path'>/usr/local/share/traccar/media</entry>
: ++    <entry key='media.path'>${LOCALBASE}/share/traccar/media</entry>
:   
:       <entry key='notificator.types'>web,mail</entry>
:   
: @@ -32,7 +35,7 @@
:       <entry key='database.ignoreUnknown'>true</entry>
:       <entry key='database.generateQueries'>true</entry>
:  -    <entry key='database.changelog'>./schema/changelog-master.xml</entry>
: -+    <entry 
key='database.changelog'>/usr/local/share/traccar/schema/changelog-master.xml</entry>
: ++    <entry 
key='database.changelog'>${LOCALBASE}/share/traccar/schema/changelog-master.xml</entry>
:    
:       <entry key='database.loginUser'>
:           SELECT * FROM tc_users
: diff --git patches/patch-conf-traccar_xml patches/patch-conf_traccar_xml
: similarity index 71%
: rename from patches/patch-conf-traccar_xml
: rename to patches/patch-conf_traccar_xml
: index a5dc7f3..6260c75 100644
: --- patches/patch-conf-traccar_xml
: +++ patches/patch-conf_traccar_xml
: @@ -1,11 +1,14 @@
: ---- conf/traccar.xml.orig    Fri Dec 14 07:55:53 2018
: -+++ conf/traccar.xml Fri Dec 14 08:26:37 2018
: +$OpenBSD$
: +
: +Index: conf/traccar.xml
: +--- conf/traccar.xml.orig
: ++++ conf/traccar.xml
:  @@ -4,7 +4,7 @@
:   
:   <properties>
:   
:  -    <entry key='config.default'>./conf/default.xml</entry>
: -+    <entry key='config.default'>/etc/traccar/default.xml</entry>
: ++    <entry 
key='config.default'>${PREFIX}/share/traccar/conf/default.xml</entry>

default.xml is not user-editable, it's meant to stay untouched, so
doesn't want to be @sample'd

:   
:       <!--
:   
: diff --git pkg/DESCR pkg/DESCR
: index 1074258..7023349 100644
: --- pkg/DESCR
: +++ pkg/DESCR
: @@ -1,4 +1,7 @@
: -Traccar is an open source GPS tracking system. It supports more than 170 GPS 
protocols and more than 1500 models of GPS tracking devices. Traccar can be 
used with any major SQL database system. It also provides easy to use REST API.
: +Traccar is an open source GPS tracking system. It supports more than 170
: +GPS protocols and more than 1500 models of GPS tracking devices. Traccar
: +can be used with any major SQL database system. It also provides an easy
: +to use REST API.

wrap to sensible line lengths, always below 80 columns, usually
below 76 or so
:  
:  Some of the available features include:
:  
: @@ -9,4 +12,3 @@ Some of the available features include:
:      Alarms and notifications
:      Account and device management
:      Email and SMS support
: -

trailing blank line

: diff --git pkg/PLIST pkg/PLIST
: index 249a028..18b78b4 100644
: --- pkg/PLIST
: +++ pkg/PLIST
: @@ -1,21 +1,23 @@
:  @comment $OpenBSD: PLIST,v 1.4 2018/09/04 12:46:19 espie Exp $
:  @newgroup _traccar:824
: -@newuser _traccar:824:_traccar:daemon:Traccar 
user:${PREFIX}/share/traccar/:/sbin/nologin
: +@newuser _traccar:824:_traccar:daemon:Traccar 
user:${PREFIX}/share/traccar:/sbin/nologin

other @newuser commands in PLISTs don't have a trailing / so neither should this

:  @rcscript ${RCDIR}/traccar
: +@extraunexec rm -r /var/db/traccar/* /var/log/traccar/*

for pkg_delete -c

:  @mode 750
:  @owner _traccar
:  @group _traccar
:  @sample /var/db/traccar/
: +@group _wheel
:  @sample /var/log/traccar/

logs that can only be read by root or the daemon user are annoying
for the sysadmin :)

: -@group
: -@owner
:  @mode
: -share/examples/traccar/
: -share/examples/traccar/traccar.xml
: +@owner
: +@group
:  share/traccar/
:  share/traccar/conf/
:  share/traccar/conf/default.xml
:  share/traccar/conf/traccar.xml
: +@sample ${SYSCONFDIR}/traccar/
: +@sample ${SYSCONFDIR}/traccar/traccar.xml
:  share/traccar/lib/
:  share/traccar/lib/HikariCP-3.2.0.jar
:  share/traccar/lib/activation-1.1.1.jar
: 

Attachment: traccar.tgz
Description: Binary data

Reply via email to