[SOLVED] compile nginx with ngx_cache_purge module

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

[SOLVED] compile nginx with ngx_cache_purge module

Postby koksnuss » Fri Nov 11, 2016 7:59 pm

hello
i like to install nginx with ngx_cache_purge module like in this guide https://www.c-rieger.de/nextcloud-installation-guide/#eins. I am new to arch linux arm so i dont now how to get the sources properly. i tried to mannualy download them from https://github.com/archlinuxarm/PKGBUILDs and even tried manually copying the content from https://archlinuxarm.org/packages/armv6h/nginx-mainline/files.

however $this->bbcode_second_pass_code('', 'makepkg -so') runs without succes, output:

$this->bbcode_second_pass_code('', '
/home/alarm/builds/nginx-mainline/PKGBUILD: line 95: unexpected EOF while looking for matching `''
/home/alarm/builds/nginx-mainline/PKGBUILD: line 104: syntax error: unexpected end of file
==> ERROR: Failed to source /home/alarm/builds/nginx-mainline/PKGBUILD
')

any helping ideas?
Last edited by koksnuss on Sun Nov 13, 2016 10:10 pm, edited 3 times in total.
koksnuss
 
Posts: 4
Joined: Fri Nov 11, 2016 7:40 pm

Re: compile nginx with ngx_cache_purge module

Postby koksnuss » Sun Nov 13, 2016 11:57 am

now i have used the PKBUILD file from the ArchLinux ARM repo from github (https://github.com/archlinuxarm/PKGBUIL ... x-mainline). The PKGBUILD differs from the one obtained from https://archlinuxarm.org/packages/armv6h/nginx-mainline.

$this->bbcode_second_pass_code('', 'diff PKGBUILD1 PKGBUILD2
2c2
< # Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
---
> # Maintainer: Bartłomiej Piotrowski
6c6
< # ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
---
> # ALARM: Kevin Mihelich
95,118c95
< sed -e 's|\<user\s\+\w\+;|user html;|g' \
< -e '44s|html|/usr/share/nginx/html|' \
< -e '54s|html|/usr/share/nginx/html|' \
< -i "$pkgdir"/etc/nginx/nginx.conf
<
< rm "$pkgdir"/etc/nginx/*.default
<
< install -d "$pkgdir"/var/lib/nginx
< install -dm700 "$pkgdir"/var/lib/nginx/proxy
<
< chmod 750 "$pkgdir"/var/log/nginx
< chown http:log "$pkgdir"/var/log/nginx
<
< install -d "$pkgdir"/usr/share/nginx
< mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
<
< install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx
< install -Dm644 ../service "$pkgdir"/usr/lib/systemd/system/nginx.service
< install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$provides/LICENSE
<
< rmdir "$pkgdir"/run
<
< install -d "$pkgdir"/usr/share/man/man8/
< gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz
---
> sed -e 's|\ "$pkgdir"/usr/share/man/man8/nginx.8.gz
127d103
<')

Aditionally i've downloaded the nginx source code from http://hg.nginx.org/ into the same dir where the PKGBUILD resides and now when i try to compile, i get the following error:
$this->bbcode_second_pass_code('', 'makepkg -so
==> ERROR: nginx-mainline is not available for the 'armv6h' architecture.
')

i don't understand this as on https://archlinuxarm.org/packages the nging-mailline package IS availibe for armv6 architectures. or is this just not true? I mean I could also install nginx-mainline as a package via pacman (wich works fine), so why should it not be possible to compile it? Please help me :-)
koksnuss
 
Posts: 4
Joined: Fri Nov 11, 2016 7:40 pm

UPDATE

Postby koksnuss » Sun Nov 13, 2016 9:45 pm

I have figured out how to archiev this. After adding 'armv6h' to the line that starts with arch=( in the PKBUILD makepkg -so runs fine!

aditionally i needed to move the service file (also from Arch Linux ARM PKGBUILD git repo):
$this->bbcode_second_pass_code('', 'mv ~/builds/nginx-mainline/service /usr/lib/systemd/system/nginx.service')

and finally i needed to manually create the folder
$this->bbcode_second_pass_code('', 'mkdir /var/lib/nginx')

after these adjustments i managed to start nginx with systemctl start nginx (as root). but why did i have to manually move the file an create the folder? is this really the way it is meant to be?
koksnuss
 
Posts: 4
Joined: Fri Nov 11, 2016 7:40 pm

Re: [SOLVED] compile nginx with ngx_cache_purge module

Postby WarheadsSE » Mon Nov 14, 2016 6:36 pm

Also, makepkg has a handy '-A' flag.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 12 guests