[SOLVED]Build rpm package mapserver 7.6.2

Issues related to applications and software problems
ElNinijo
Posts: 8
Joined: 2021/03/06 16:27:19

[SOLVED]Build rpm package mapserver 7.6.2

Post by ElNinijo » 2021/03/06 16:32:56

Hello

I try to build rpm package for mapserver 7.6.2
Use this instruction: https://github.com/pablomp/mapserver-7.0.7-Spec

And i cannot properly build rpm package.
I received error:

Code: Select all

/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_94952] Error 1
gmake[1]: Leaving directory `/root/rpmbuild/BUILD/mapserver-7.6.2/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_94952/fast] Error 2
I cannot solve this problem, maybe someone can help me to build properly rpm package mapserver 7.6.2 for centos 7

Big thx for your help
Last edited by ElNinijo on 2021/08/05 17:37:38, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 32030
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Build rpm package mapserver 7.6.2

Post by TrevorH » 2021/03/06 19:31:40

1) don't build things as root

Try installing the 'mock' package, add your user to the mock group then logout and back in again and try building your SRPM with mock --rebuild /path/to/your.src.rpm and see if things are any better.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

ElNinijo
Posts: 8
Joined: 2021/03/06 16:27:19

Re: Build rpm package mapserver 7.6.2

Post by ElNinijo » 2021/03/07 06:49:02

Try installing the 'mock' package, add your user to the mock group then logout and back in again
I did it but i have source tar.gz https://download.osgeo.org/mapserver/ma ... 6.2.tar.gz

Is possible to use mock to build rpm packacge from tar.gz?

i received this error:
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.HPBJj5 (%build)
Bad exit status from /var/tmp/rpm-tmp.HPBJj5 (%build)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 600, in do_with_status
raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed:
# /usr/bin/systemd-nspawn -q -M d8ecdbf5eb2640b4aed816e94d9cfaad -D /var/lib/mock/epel-7-x86_64/root -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.zpbh3pyp:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$ --setenv=LANG=C.UTF-8 bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/mapserver-7.0.spec

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Build rpm package mapserver 7.6.2

Post by sml » 2021/03/07 12:30:58

EPEL 7 has qgis-server that provides similar functionality.

ElNinijo
Posts: 8
Joined: 2021/03/06 16:27:19

Re: Build rpm package mapserver 7.6.2

Post by ElNinijo » 2021/03/07 13:07:43

I know but in my enviroment it must mapserver due to i can't switch to another software and i have to use mapserver

and i try to learn build my own rpm package with mapserver

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Build rpm package mapserver 7.6.2

Post by sml » 2021/03/07 14:10:40

The error message you provided is just a generic message you get at the end of mock output as a consequence of a mock build failure. The actual error message is higher in the output of mock (or in /var/lib/mock/<chroot-name>/result/build.log). Sometimes, much higher (like ten or even fifty screenfuls earlier).

ElNinijo
Posts: 8
Joined: 2021/03/06 16:27:19

Re: Build rpm package mapserver 7.6.2

Post by ElNinijo » 2021/03/07 14:44:47

I checked this file (build.log) in this is the only section where is info about some error, there is nothing more.

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Build rpm package mapserver 7.6.2

Post by sml » 2021/03/10 12:17:12

ElNinijo wrote:
2021/03/09 04:34:58
could you check on you own machine if you can proper build package wih mapserver
This is the error message I get when building mapserver 7.0.7 (your spec file unchanged)
Make Error at CMakeLists.txt:468 (MESSAGE):
ORACLE_HOME environment variable not set, needed for detection

-- Could NOT find ORACLE (missing: ORACLE_LIBRARY)
CMake Error at CMakeLists.txt:69 (message):
ORACLESPATIAL library/component/dependency could not be found.

HINTS:
- disable ORACLESPATIAL support by adding -DWITH_ORACLESPATIAL=0
- add the ORACLESPATIAL install directory to the CMAKE_PREFIX_PATH variable (-DCMAKE_PREFIX_PATH="/path/to/ORACLESPATIAL-install-dir;/path/to/other/dirs"
And the build instruction you linked to states
Requires EPEL Repository and Oracle InstantClient libraries
With ORACLESPATIAL disabled as hinted in the error message, it builds fine. Uploaded here.

And this is the error message I get when building mapserver 7.6.2
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.0 or higher is required. You are running version 2.8.12.2
After changing cmake to cmake3 in the spec file, the error message I get is
-- Could NOT find ProtobufC (missing: PROTOBUFC_LIBRARY PROTOBUFC_COMPILER PROTOBUFC_INCLUDE_DIR)
CMake Error at CMakeLists.txt:91 (message):
PROTOBUFC library/component/dependency could not be found.

HINTS:
- disable PROTOBUFC support by adding -DWITH_PROTOBUFC=0
- add the PROTOBUFC install directory to the CMAKE_PREFIX_PATH variable (-DCMAKE_PREFIX_PATH="/path/to/PROTOBUFC-install-dir;/path/to/other/dirs"
With protobuf-c-devel added to BuildRequires, I get
/builddir/build/BUILD/mapserver-7.6.2/mapraster.c:650:36: error: 'GDAL_OF_RASTER' undeclared (first use in this function)
GDAL_OF_RASTER | GDAL_OF_SHARED,
^
/builddir/build/BUILD/mapserver-7.6.2/mapraster.c:650:36: note: each undeclared identifier is reported only once for each function it appears in
/builddir/build/BUILD/mapserver-7.6.2/mapraster.c:650:53: error: 'GDAL_OF_SHARED' undeclared (first use in this function)
GDAL_OF_RASTER | GDAL_OF_SHARED,
gdal-devel is listed in BuildRequires, so I guess mapserver 7.6.2 requires a newer version of GDAL than what provided by EPEL 7.

User avatar
TrevorH
Forum Moderator
Posts: 32030
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Build rpm package mapserver 7.6.2

Post by TrevorH » 2021/03/10 12:41:15

There are cmake3* packages in EPEL.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

ElNinijo
Posts: 8
Joined: 2021/03/06 16:27:19

Re: Build rpm package mapserver 7.6.2

Post by ElNinijo » 2021/03/10 15:09:08

So you suggest that firstly i need to know which version gdal is needed by the newest version of mapserver and than try to build it?

I found this:
Here are the (as of 2021-01-22) optimal combinations of MapServer with GDAL & PROJ:

MapServer 7.6.2 + GDAL 2.4.4 + PROJ 5.2.0 (GDAL 2 series)
MapServer 7.6.2 + GDAL 3.2.1 + PROJ 7.2.1 (GDAL 3 series)

Post Reply