You are not logged in.

#1 2014-05-13 17:48:07

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Request a contributer to build my PKGBUILD

Hello,

I'm using archlinux for programming and I need a PKGBUILD to distribute my source code which is versionned in the code.google GIT.

So far, I have written this simple PKGBUILD that I find very far from the guidelines.

# Maintainer: CyrIng <webmaster@cyring.fr>

pkgname=xfreq
pkgver=0.26 
pkgrel=1
pkgdesc="Intel Core Monitoring Widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('')
makedepends=('libx11')
optdepends=('')
options=('!emptydirs')
changelog=ChangeLog
source=(http://code.google.com/p/xfreq/${pkgname}/${pkgname}-${pkgver}.tar.gz)
md5sums=('0c159b8b7384d6343b6695e43c2dae85')

build() {
        cd "${srcdir}/${pkgname}-${pkgver}"
        make
}

package() {
        cd "${srcdir}/${pkgname}-${pkgver}"
        cp bin/xfreq /usr/local/bin/
}

Because I prefer to focus more on programming, I wish one contributor may take in charge the Arch packaging part.
Let me know if you would like to do it.

Regards

CyrIng

Offline

#2 2014-05-14 12:11:35

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,239

Re: Request a contributer to build my PKGBUILD

a few comments :

man PKGBUILD wrote:

changelog
           Specifies a changelog file that is to be included in the package. This file should reside in the same directory as
           the PKGBUILD, and will be copied into the package by makepkg. It does not need to be included in the source array
           (e.g., changelog=$pkgname.changelog).

to put it simple, this changelog is NOT the one you have in the sourcecode.
-------------------------------

The archive you created is part of your sourcecode in git now, and not dowloadable directly afaict.
I downloaded a git snapshot and copied xfreq-0.26.tar.gz manually to the build folder for now.

-----------------------------
/usr/local/ is rarely used on arch

---------------

during build you list the prerequisites. the maintainer of this package should put those in an .install file

-------------------------------------

NOTE : all my systems are amd-based, i'm just helping out.

Here's a PKGBUILD that does build (when the downloaded source tarball is present in the buildfolder)

# Maintainer: CyrIng <webmaster@cyring.fr>

pkgname=xfreq
pkgver=0.26 
pkgrel=1
pkgdesc="Intel Core Monitoring Widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(xfreq-0.26.tar.gz)
md5sums=('0c159b8b7384d6343b6695e43c2dae85')

build() {
        cd "${srcdir}/${pkgname}"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2014-05-27 06:09:56

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

Hello, Thanks a lot for your advices that I will follow, and sorry being late to answer due to the fact that I have to rewrite a consequente part of the code to make it more modular (layers of code for processors, daemon, GUI, etc.)
Meanwhile, I still have to decide how to retrieve sources with less packaging maintenance (such as building tgz, the configure files, md5sums, etc.)

So far, I think I could 'wget' the following URLs in the build() function or in the url="..." statement (if I can put more than one string ?)
http://xfreq.googlecode.com/git/xfreq.c
http://xfreq.googlecode.com/git/xfreq.h
http://xfreq.googlecode.com/git/README
http://xfreq.googlecode.com/git/Makefile
Run 'make'
Then your package() function to install in '/usr/bin/'

Btw, did you try to run XFreq with your AMD ? I wonder if it works with the Genuine algorithm ?
you may try 'xfreq -c 0'

Regards

CyrIng

Lone_Wolf wrote:

a few comments :

man PKGBUILD wrote:

changelog
           Specifies a changelog file that is to be included in the package. This file should reside in the same directory as
           the PKGBUILD, and will be copied into the package by makepkg. It does not need to be included in the source array
           (e.g., changelog=$pkgname.changelog).

to put it simple, this changelog is NOT the one you have in the sourcecode.
-------------------------------

The archive you created is part of your sourcecode in git now, and not dowloadable directly afaict.
I downloaded a git snapshot and copied xfreq-0.26.tar.gz manually to the build folder for now.

-----------------------------
/usr/local/ is rarely used on arch

---------------

during build you list the prerequisites. the maintainer of this package should put those in an .install file

-------------------------------------

NOTE : all my systems are amd-based, i'm just helping out.

Here's a PKGBUILD that does build (when the downloaded source tarball is present in the buildfolder)

# Maintainer: CyrIng <webmaster@cyring.fr>

pkgname=xfreq
pkgver=0.26 
pkgrel=1
pkgdesc="Intel Core Monitoring Widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(xfreq-0.26.tar.gz)
md5sums=('0c159b8b7384d6343b6695e43c2dae85')

build() {
        cd "${srcdir}/${pkgname}"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

Last edited by CyrIng (2014-05-27 06:10:38)

Offline

#4 2014-05-28 14:13:24

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,239

Re: Request a contributer to build my PKGBUILD

Cyring,

the msr module loads without errors and xfreq does run on my amd system.

However none of the MSR registers you check for are found, so xfreq works but doesn't display values.

I noticed you update frequently, you might want to start with a xfreq-git package (that would also mean you don't have to supply tar.gz files for now)

# Maintainer: CyrIng <webmaster@cyring.fr>

pkgname=xfreq-git
pkgver=53.a7b0582 
pkgrel=1
pkgdesc="Intel Core Monitoring Widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(${pkgname}::git+https://code.google.com/p/xfreq/)
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
        cd "${srcdir}/${pkgname}"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2014-05-28 15:42:44

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

Hi Wolf

Thanks a lot for your PKGBUILD

True, I do update frequently because I keep having news ideas for the GUI. That's why I'm now splitting the code into 2 main layers: the backend part, closed to the hardware, and the frontend part for the GUI. This would provide the right amount of updates necessary for each layers.
More important, the backend as a daemon should be the only process requiring the root privileges; meaning that a SystemD integration will be necessary.
On its side, the GUI frontend won't need root which is a better way to do, especially  if I don't want to cause a mess in the user's setup. For example the case of the XFreq configuration file (.xfreq) which is currently saved in /root
This would also provide more flexibility to introduce other processor brands : AMD is on my short list, if I can put the hand on its MSR secrets !
The frontend won't only be a GUI. I think a network agent could be an intermediate between the hardware and the GUI. The rest is a matter of network protocol.

Short terms, this should produce the following exchange  (from the BE to the FE, through a shared memory) :

  xfreq-intel.c  --> [shm]  --> xfreq.c


Second step would introduce other Processors :

  xfreq-amd  --> [shm]  --> xfreq-[gui].c

and could be opened to other GUI frameworks (QT, gtk, Win32)

  xfreq-[intel|amd]  --> [shm]  --> xfreq-[gui].c


Later :

  xfreq-[intel|amd].c  -->  [shm]  -->  xfreq-agent.c  -->  [net]  -->  xfreq-agent.c  --> [shm]  -->  xfreq-[gui].c


All of these will require an appropriated packaging, in particular the shm's directory, probably /run
I'm not sure how to deal with the GIT repository : shoud it evolve to store respectively the server and client source files ?
Create a new branch to offer the last available code before the Split ?

Once again, thanks a lot for your help
Best regards
CyrIng

Lone_Wolf wrote:

Cyring,

the msr module loads without errors and xfreq does run on my amd system.

However none of the MSR registers you check for are found, so xfreq works but doesn't display values.

I noticed you update frequently, you might want to start with a xfreq-git package (that would also mean you don't have to supply tar.gz files for now)

# Maintainer: CyrIng <webmaster@cyring.fr>

pkgname=xfreq-git
pkgver=53.a7b0582 
pkgrel=1
pkgdesc="Intel Core Monitoring Widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(${pkgname}::git+https://code.google.com/p/xfreq/)
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
        cd "${srcdir}/${pkgname}"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

Last edited by CyrIng (2014-05-28 15:51:32)

Offline

#6 2014-06-05 09:02:04

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

Hello,

I just have pushed the Clients-Server source code, next version 2.0
The files repository is a bit more sophisticated as before; one needs to compile a daemon which needs to run as root, then compile the GUI or the text mode clients with regular user permissions. The PKGBUILD could do all of that.
A question is how to make sure that the user has installed and mounted the shared memory in the /dev/shm tree ?
Could it be a makedepends statement or sort of request to do it.

Regards
CyrIng

Offline

#7 2014-06-05 11:40:49

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,239

Re: Request a contributer to build my PKGBUILD

dev/shm wiki page wrote:

Note: Arch Linux now uses systemd which handles mounting the /dev/shm filesystem automatically. Therefore, this entry into the fstab is no longer necessary.

So it should be present and accessible, but ofcourse /dev/shm has a size limit.

I think best approach would be to write a wrapper command to start the daemon.
the wrapper should include a check for the available space in dev/shm , and fail if it's below a certain value .
To start the wrapper you should provide a simple systemd .service file .

look into /usr/lib/systemd/system/cpupower.service & /usr/lib/systemd/scripts/cpupower to see how they do it.

Note :
it may be possible to include the /dev/shm sizecheck in the .service-file, but if you do that you'll make it harder for non-systemd users to use xfreq.
If at some point in the future you to intend xfreq to work on most *nixes, keep the .service file as simple as possible and let the wrapper do the important stuff.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#8 2014-06-05 11:50:34

fukawi2
Forum Moderator
From: .vic.au
Registered: 2007-09-28
Posts: 5,283
Website

Re: Request a contributer to build my PKGBUILD

Moving to "AUR Issues, Discussion & PKGBUILD Requests" sub-forum

Offline

#9 2014-06-05 16:24:49

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

Indeed, SystemD makes it easier, shm should already be mounted. However, I don't use a lot, so far 28KB
Perhaps one  issue is that the '/dev/shm/xfreq-shm' file needs to be created by root with R/W permissions to allow clients to map this memory. (it's a functional constraint that I met when trying to share Condition mutex)

I will give a look to the .service samples,
Thanks again.

Lone_Wolf wrote:
dev/shm wiki page wrote:

Note: Arch Linux now uses systemd which handles mounting the /dev/shm filesystem automatically. Therefore, this entry into the fstab is no longer necessary.

So it should be present and accessible, but ofcourse /dev/shm has a size limit.

I think best approach would be to write a wrapper command to start the daemon.
the wrapper should include a check for the available space in dev/shm , and fail if it's below a certain value .
To start the wrapper you should provide a simple systemd .service file .

look into /usr/lib/systemd/system/cpupower.service & /usr/lib/systemd/scripts/cpupower to see how they do it.

Note :
it may be possible to include the /dev/shm sizecheck in the .service-file, but if you do that you'll make it harder for non-systemd users to use xfreq.
If at some point in the future you to intend xfreq to work on most *nixes, keep the .service file as simple as possible and let the wrapper do the important stuff.

Offline

#10 2014-06-05 17:29:39

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: Request a contributer to build my PKGBUILD

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

Variables such as pkgdir may contain spaces and should therefore be quoted to avoid word expansion. You can also replace the 3 commands in that function with

package() {
        install -Dm755 "$srcdir/$pkgname/bin/xfreq" "$pkgdir/usr/bin/xfreq"
}

Offline

#11 2014-06-05 19:02:59

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,528
Website

Re: Request a contributer to build my PKGBUILD

@op - Nice util, please upload to the AUR.  Taking everyone's suggestions:

# Maintainer: Your Name <youremail@domain.com>
pkgname=xfreq-git
_pkgname=xfreq
pkgver=54.8ed1636
pkgrel=1
pkgdesc="Intel core monitoring widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=("$_pkgname::git+https://code.google.com/p/xfreq")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
  cd "$_pkgname"
  make
}

package() {
  install -Dm755 "$_pkgname/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2014-06-06 05:53:28

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

I will try to push a PKGBUILD in AUR : I need to replace before the Maintainer name & email domain with new names made especially for XFreq.
Can I write [at] rather than @ in email, just to avoid  bots, etc ?
CyrIng

graysky wrote:

@op - Nice util, please upload to the AUR.  Taking everyone's suggestions:

# Maintainer: Your Name <youremail@domain.com>
pkgname=xfreq-git
_pkgname=xfreq
pkgver=54.8ed1636
pkgrel=1
pkgdesc="Intel core monitoring widgets"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=("$_pkgname::git+https://code.google.com/p/xfreq")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
  cd "$_pkgname"
  make
}

package() {
  install -Dm755 "$_pkgname/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}

Offline

#13 2014-06-06 12:08:21

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

I have submitted the XFreq package in the AUR
On git, I have uploaded a 'cleaner' Makefile and change the version of source code to 1.0 RC1

Program should be installed in /usr/bin/xfreq

Be aware that this GUI version of XFreq must be run with the root user (to allow an access to the CPU MSR registers)

Have a nice WE
CyrIng

Offline

#14 2014-06-06 14:43:41

progandy
Member
Registered: 2012-05-17
Posts: 2,151

Re: Request a contributer to build my PKGBUILD

CyrIng wrote:

I just have pushed the Clients-Server source code, next version 2.0

If / When you have a stable release you want to publish as an archive, then use the dedicated downloads section in your googlecode project. Avoid sourcecode archives inside your git tree. You should already have the archived version as a tag, so the archive is not needed there.

Offline

#15 2014-06-07 06:22:27

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

progandy wrote:

If / When you have a stable release you want to publish as an archive, then use the dedicated downloads section in your googlecode project. Avoid sourcecode archives inside your git tree. You should already have the archived version as a tag, so the archive is not needed there.

I have tried but I'm struggling with branches.
I wante to separate the 1.0 and the on-going development of 2.0 where source file names are changed.
That's not trivial, it happened I had lost some code because I don't master git.

Offline

#16 2014-06-14 00:16:58

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

I'm now writing 3 x PKGBUILD, one per component (xfreq-intel , xfreq-cli and xfreq-gui) whose sources are in their respective folders of the branch named 2.0

However I don't find a way to clone a specific folder to build the package ?

For instance, in the xfreq-intel PKGBUILD, i have append ?name=2.0 to the url, but this fails.

# Maintainer: CyrIng <xfreq[at]cyring.fr>

pkgname=xfreq-intel-git
pkgver=2.0_b0.32
pkgrel=1
pkgdesc="Intel Core Monitoring Server"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=()
makedepends=()
conflicts=('xfreq-git')
options=('!emptydirs')
source=(${pkgname}::git+https://code.google.com/p/xfreq/?name=2.0)
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
        cd "${srcdir}/${pkgname}"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${pkgname}"
        install -m 755 bin/xfreq-intel ${pkgdir}/usr/bin/
        install -m 644 xfreq-intel.service "${pkgdir}/usr/lib/systemd/system/xfreq-intel.service"
}

In fact, what I would like to do is to only retrieve from the git repository the 2.0/svr and the 2.0/api folders to build the package.

Last edited by CyrIng (2014-06-14 00:47:56)

Offline

#17 2014-06-14 01:26:21

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,979

Re: Request a contributer to build my PKGBUILD

You can't do that with git. It's all or nothing.

Offline

#18 2014-06-14 08:22:57

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

I'm trying with an archive download from code.google but the folder name inside the zip file is not predictable

# Maintainer: CyrIng <xfreq[at]cyring.fr>

pkgname=xfreq-2.0-git
pkgver=2.0_b0.32
pkgrel=1
pkgdesc="Intel Core Monitoring"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
conflicts=('xfreq-git')
options=('!emptydirs')
wkdir="2.0"
source=(https://xfreq.googlecode.com/archive/${wkdir}.zip)
md5sums=('SKIP')

build() {
        cd "${srcdir}/${wkdir}/svr"
        make
        cd "${srcdir}/${wkdir}/cli"
        make
        cd "${srcdir}/${wkdir}/gui"
        make
}

package() {
        mkdir -p ${pkgdir}/usr/bin
        cd "${srcdir}/${wkdir}/svr"
        install -m 755 bin/xfreq-intel ${pkgdir}/usr/bin/
        install -m 644 xfreq-intel.service "${pkgdir}/usr/lib/systemd/system/xfreq-intel.service"
	systemctl enable xfreq-intel
	systemctl start xfreq-intel
        cd "${srcdir}/${wkdir}/cli"
        install -m 755 bin/xfreq-cli ${pkgdir}/usr/bin/
        cd "${srcdir}/${wkdir}/gui"
        install -m 755 bin/xfreq-gui ${pkgdir}/usr/bin/
}

Offline

#19 2014-06-14 09:45:41

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,528
Website

Re: Request a contributer to build my PKGBUILD

Hmmm... just build a spilt package, one PKGBUILD that provides all three packages.  Can you use git tags?  If the problem is the google code host, switch to github.  Also, do not have the PKGBUILD start a daemon.  Instead use a post_install script to do that.  See an example readme.install for syntax.

EDIT: Using your PKGBUILD in the AUR as a model for the split:

# Maintainer: CyrIng <xfreq[at]cyring.fr>

pkgname=('xfreq-intel' 'xfreq-cli' 'xfreq-gui')
pkgbase=xfreq-git
pkgver=55.7fe7aa8
pkgrel=1
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(${pkgname}::git+https://code.google.com/p/xfreq/)
md5sums=('SKIP')
install=readme.install

pkgver() {
	cd "${srcdir}/${pkgname}"
	echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
	cd "${srcdir}/${pkgname}"
	make
}

package_xfreq-intel() {
	pkgdesc="Base utils of Intel core monitoring widgets"
	mkdir -p ${pkgdir}/usr/bin
	cd "${srcdir}/${pkgname}"
	install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

package_xfreq-cli() {
	pkgdesc="CLI version of Intel core monitoring widgets"
	requires=xfreq-intel
	/bin/true
}

package_xfreq-gui() {
	requires=xfreq-intel
	pkgdesc="GUI version of Intel Core Monitoring Widgets"
	/bin/true
}

readme.install from one of my packages.  Edit it as you require.  Again, do not start a daemon within it, but do echo the instructions to the user in a minimum number of characters:

post_install() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
	echo 'In order to use nvidia module, reboot the system.'
}

post_upgrade() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
	if [ "$(vercmp $2 310.19-2)" -lt 0 ]; then
		echo 'If your card is from the 7xxx series or earlier, install nvidia-304xx-ck'
	fi
}

post_remove() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
}

Last edited by graysky (2014-06-14 09:58:41)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#20 2014-06-14 11:40:23

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

Thanks a lot !
meanwhile I did this :

# Maintainer: CyrIng <xfreq[at]cyring.fr>

pkgname=xfreq-2.0-git
pkgver=2.0_b0.32
pkgrel=1
pkgdesc="Intel Core Monitoring"
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11' 'git')
conflicts=('xfreq-git')
options=('!emptydirs')
branch="2.0"
source=()
md5sums=('SKIP')

build() {
	git clone https://code.google.com/p/xfreq/ -b ${branch} --single-branch .
	cd "${srcdir}/${branch}/svr"
	make
	cd "${srcdir}/${branch}/cli"
	make
	cd "${srcdir}/${branch}/gui"
	make
}

and to handle the SystemD service :

package() {
	mkdir -p ${pkgdir}/usr/bin
	cd "${srcdir}/${branch}/svr"
	install -m 755 bin/xfreq-intel ${pkgdir}/usr/bin/
        install -Dm 644 xfreq-intel.service "${pkgdir}/usr/lib/systemd/system/xfreq-intel.service"
	cd "${srcdir}/${branch}/cli"
	install -m 755 bin/xfreq-cli ${pkgdir}/usr/bin/
	cd "${srcdir}/${branch}/gui"
	install -m 755 bin/xfreq-gui ${pkgdir}/usr/bin/
# Post installation of the SystemD service.
	install=xfreq.install
}

where the xfreq.install file is

#!/bin/sh

post_install() {
	systemctl enable xfreq-intel
	systemctl start xfreq-intel
}

and xfreq-intel.service contains:

[Unit]
Description=XFreq Intel Daemon

[Service]
Type=oneshot
ExecStart=/usr/bin/xfreq-intel
ExecStop=/usr/bin/kill -s SIGQUIT `/usr/bin/pidof xfreq-intel`
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

So far, package installation is working but service startup is locking.

According to you, is oneshot the right service type ?

Regards
CyrIng

graysky wrote:

Hmmm... just build a spilt package, one PKGBUILD that provides all three packages.  Can you use git tags?  If the problem is the google code host, switch to github.  Also, do not have the PKGBUILD start a daemon.  Instead use a post_install script to do that.  See an example readme.install for syntax.

EDIT: Using your PKGBUILD in the AUR as a model for the split:

# Maintainer: CyrIng <xfreq[at]cyring.fr>

pkgname=('xfreq-intel' 'xfreq-cli' 'xfreq-gui')
pkgbase=xfreq-git
pkgver=55.7fe7aa8
pkgrel=1
arch=('x86_64')
url="http://code.google.com/p/xfreq/"
license=('GPL2')
depends=('libx11')
makedepends=('libx11')
options=('!emptydirs')
source=(${pkgname}::git+https://code.google.com/p/xfreq/)
md5sums=('SKIP')
install=readme.install

pkgver() {
	cd "${srcdir}/${pkgname}"
	echo $(git rev-list --count master).$(git rev-parse --short master)
}

build() {
	cd "${srcdir}/${pkgname}"
	make
}

package_xfreq-intel() {
	pkgdesc="Base utils of Intel core monitoring widgets"
	mkdir -p ${pkgdir}/usr/bin
	cd "${srcdir}/${pkgname}"
	install -m 755 bin/xfreq ${pkgdir}/usr/bin/
}

package_xfreq-cli() {
	pkgdesc="CLI version of Intel core monitoring widgets"
	requires=xfreq-intel
	/bin/true
}

package_xfreq-gui() {
	requires=xfreq-intel
	pkgdesc="GUI version of Intel Core Monitoring Widgets"
	/bin/true
}

readme.install from one of my packages.  Edit it as you require.  Again, do not start a daemon within it, but do echo the instructions to the user in a minimum number of characters:

post_install() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
	echo 'In order to use nvidia module, reboot the system.'
}

post_upgrade() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
	if [ "$(vercmp $2 310.19-2)" -lt 0 ]; then
		echo 'If your card is from the 7xxx series or earlier, install nvidia-304xx-ck'
	fi
}

post_remove() {
	EXTRAMODULES='extramodules-3.14-ck'
	depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
}

Offline

#21 2014-06-14 12:18:48

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

[Service]
Type=oneshot
ExecStart=/usr/bin/xfreq-intel

My ExecStart sounds to be the issue whatever the Type is, because xfreq-intel is running into a loop: no fork.
So I see 3 solutions:
1- modify source code to fork
2- send process into background without a shell script wrapper ?
3- ask SystemD to background the process ?

Offline

#22 2014-06-17 11:20:31

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,239

Re: Request a contributer to build my PKGBUILD

graysky wrote:

readme.install from one of my packages.  Edit it as you require.  Again, do not start a daemon within it, but do echo the instructions to the user in a minimum number of characters:

Cyring, looks like you missed the above.
Sorry, can't help with the systemd service file.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#23 2014-06-17 13:44:04

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: Request a contributer to build my PKGBUILD

man systemd.service wrote:

       Type=
           Configures the process start-up type for this service unit. One of simple, forking, oneshot, dbus, notify or idle.

           If set to simple (the default value if neither Type= nor BusName= are specified), it is expected that the process configured with ExecStart= is the main process
           of the service. In this mode, if the process offers functionality to other processes on the system, its communication channels should be installed before the
           daemon is started up (e.g. sockets set up by systemd, via socket activation), as systemd will immediately proceed starting follow-up units.
...
           Behavior of oneshot is similar to simple; however, it is expected that the process has to exit before systemd starts follow-up units.  RemainAfterExit= is
           particularly useful for this type of service.

It seems you want Type=simple, or simply don't specify the Type at all.

Offline

#24 2014-06-21 08:07:17

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 76
Website

Re: Request a contributer to build my PKGBUILD

So 'Simple'
Thanks SidK

[Unit]
Description=XFreq Intel Daemon

[Service]
Type=simple
ExecStart=/usr/bin/xfreq-intel
ExecStop=/bin/kill -QUIT $MAINPID
RemainAfterExit=no
SuccessExitStatus=SIGQUIT SIGUSR1 SIGTERM

[Install]
WantedBy=multi-user.target

Offline

#25 2014-06-21 10:11:42

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,528
Website

Re: Request a contributer to build my PKGBUILD

So which PKGBUILD supplies the current dev version?  You have 3 in the AUR.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB