Custom RPM

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
silvex

Custom RPM

Post by silvex »

I am trying to create a custom RPM for ImageMagick-6.6.3-7. I am able to create the regular RPM, which installs under /. I need to create a different install path to /opt/applications/tools. I configured it with "configure --prefix=/opt/applications/tools --exec-prefix=/opt/applications/tools.

It does built the RPM but not using that prefix. It uses the / prefix.
silvex

Re: Custom RPM

Post by silvex »

If I do a "make install" it goes to my custom directory. So..what am I missing ?

Code: Select all


tar xvf /root/ImageMagick.tar.gz
cd ImageMagick-6.6.3-7
rm config.status config.log
./configure --prefix=/opt/MyApps/tools --exec-prefix=/opt/MyApps/tools --without-perl --without-magick-plus-plus

Options used to compile and link:
PREFIX = /opt/MyApps/tools
EXEC-PREFIX = /opt/MyApps/tools
VERSION = 6.6.3
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -g -O2 -Wall -pthread
CPPFLAGS = -I/opt/MyApps/tools/include/ImageMagick
PCFLAGS =
DEFS = -DHAVE_CONFIG_H
LDFLAGS = -L/usr/X11R6/lib64
MAGICK_LDFLAGS = -L/opt/MyApps/tools/lib -L/usr/X11R6/lib64

ImageMagick.spec

%build
%configure --enable-shared \
--disable-static \
--with-modules \
--with-perl \
--with-x \
--with-threads \
--with-magick_plus_plus \
--with-gslib \
--with-wmf \
--with-lcms \
--with-rsvg \
--with-xml \
--with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
--without-dps \
--without-included-ltdl --with-ltdl-include=%{_includedir} \
--with-ltdl-lib=%{_libdir}


The Makefile DOES have my /opt/MyApps/tools path.

Code: Select all


tstv9:~/src/ImageMagick-6.6.3-7 # grep MyApps *
Makefile:BIN_DIR = /opt/MyApps/tools/bin
Makefile:CODER_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders
Makefile:CONFIGURE_ARGS = ./configure  '--prefix=/opt/MyApps/tools' '--exec-prefix=/opt/MyApps/tools' '--without-perl' '--without-magick-plus-plus'
Makefile:CONFIGURE_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/config/
Makefile:DATA_DIR = /opt/MyApps/tools/share
Makefile:DOCUMENTATION_PATH = /opt/MyApps/tools/share/doc/ImageMagick-6.6.3
Makefile:DisplayDelegate = /opt/MyApps/tools/bin/display
Makefile:EXECUTABLE_PATH = /opt/MyApps/tools/bin
Makefile:EXEC_PREFIX_DIR = /opt/MyApps/tools
Makefile:FILTER_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters
Makefile:INCLUDE_DIR = /opt/MyApps/tools/include
Makefile:INFO_DIR = /opt/MyApps/tools/share/info
Makefile:LIBEXEC_DIR = /opt/MyApps/tools/libexec
Makefile:LIBRARY_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3
Makefile:LIB_DIR = /opt/MyApps/tools/lib
Makefile:LOCALSTATE_DIR = /opt/MyApps/tools/var
Makefile:MAGICKCORE_PATH = /opt/MyApps/tools/lib
Makefile:MAGICK_CPPFLAGS = -I/opt/MyApps/tools/include/ImageMagick
Makefile:MAGICK_LDFLAGS = -L/opt/MyApps/tools/lib -L/usr/X11R6/lib64
Makefile:MAN_DIR = /opt/MyApps/tools/share/man
Makefile:PREFIX_DIR = /opt/MyApps/tools
Makefile:SBIN_DIR = /opt/MyApps/tools/sbin
Makefile:SHAREDSTATE_DIR = /opt/MyApps/tools/com
Makefile:SHARE_CONFIGURE_PATH = /opt/MyApps/tools/share/ImageMagick-6.6.3/config
Makefile:SHARE_PATH = /opt/MyApps/tools/share/ImageMagick-6.6.3
Makefile:SYSCONF_DIR = /opt/MyApps/tools/etc
Makefile:exec_prefix = /opt/MyApps/tools
Makefile:prefix = /opt/MyApps/tools
config.log:  $ ./configure --prefix=/opt/MyApps/tools --exec-prefix=/opt/MyApps/tools --without-perl --without-magick-plus-plus
config.log:  PREFIX          = /opt/MyApps/tools
config.log:  EXEC-PREFIX     = /opt/MyApps/tools
config.log:  CPPFLAGS        = -I/opt/MyApps/tools/include/ImageMagick
config.log:  MAGICK_LDFLAGS  = -L/opt/MyApps/tools/lib -L/usr/X11R6/lib64
config.log:BIN_DIR='/opt/MyApps/tools/bin'
config.log:CODER_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders'
config.log:CONFIGURE_ARGS='./configure  '\''--prefix=/opt/MyApps/tools'\'' '\''--exec-prefix=/opt/MyApps/tools'\'' '\''--without-perl'\'' '\''--without-magick-plus-plus'\'''
config.log:CONFIGURE_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/'
config.log:DATA_DIR='/opt/MyApps/tools/share'
config.log:DOCUMENTATION_PATH='/opt/MyApps/tools/share/doc/ImageMagick-6.6.3'
config.log:DisplayDelegate='/opt/MyApps/tools/bin/display'
config.log:EXECUTABLE_PATH='/opt/MyApps/tools/bin'
config.log:EXEC_PREFIX_DIR='/opt/MyApps/tools'
config.log:FILTER_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters'
config.log:INCLUDE_DIR='/opt/MyApps/tools/include'
config.log:INFO_DIR='/opt/MyApps/tools/share/info'
config.log:LIBEXEC_DIR='/opt/MyApps/tools/libexec'
config.log:LIBRARY_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3'
config.log:LIB_DIR='/opt/MyApps/tools/lib'
config.log:LOCALSTATE_DIR='/opt/MyApps/tools/var'
config.log:MAGICKCORE_PATH='/opt/MyApps/tools/lib'
config.log:MAGICK_CPPFLAGS='-I/opt/MyApps/tools/include/ImageMagick'
config.log:MAGICK_LDFLAGS='-L/opt/MyApps/tools/lib -L/usr/X11R6/lib64'
config.log:MAN_DIR='/opt/MyApps/tools/share/man'
config.log:PREFIX_DIR='/opt/MyApps/tools'
config.log:SBIN_DIR='/opt/MyApps/tools/sbin'
config.log:SHAREDSTATE_DIR='/opt/MyApps/tools/com'
config.log:SHARE_CONFIGURE_PATH='/opt/MyApps/tools/share/ImageMagick-6.6.3/config'
config.log:SHARE_PATH='/opt/MyApps/tools/share/ImageMagick-6.6.3'
config.log:SYSCONF_DIR='/opt/MyApps/tools/etc'
config.log:exec_prefix='/opt/MyApps/tools'
config.log:prefix='/opt/MyApps/tools'
config.log:#define EXECUTABLE_PATH "/opt/MyApps/tools/bin/"
config.log:#define LIBRARY_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/"
config.log:#define CONFIGURE_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/"
config.log:#define CODER_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders/"
config.log:#define FILTER_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters/"
config.log:#define DOCUMENTATION_PATH "/opt/MyApps/tools/share/doc/ImageMagick-6.6.3/"
config.log:#define SHARE_PATH "/opt/MyApps/tools/share/ImageMagick-6.6.3/"
config.log:#define SHARE_CONFIGURE_PATH "/opt/MyApps/tools/share/ImageMagick-6.6.3/config/"
config.status:ac_cs_config="'--prefix=/opt/MyApps/tools' '--exec-prefix=/opt/MyApps/tools' '--without-perl' '--without-magick-plus-plus' --enable-ltdl-convenience"
config.status:  set X '/bin/sh' './configure'  '--prefix=/opt/MyApps/tools' '--exec-prefix=/opt/MyApps/tools' '--without-perl' '--without-magick-plus-plus' --enable-ltdl-convenience $ac_configure_extra_args --no-create --no-recursion
config.status:S["MAGICK_LDFLAGS"]="-L/opt/MyApps/tools/lib -L/usr/X11R6/lib64"
config.status:S["MAGICK_CPPFLAGS"]="-I/opt/MyApps/tools/include/ImageMagick"
config.status:S["MAGICKCORE_PATH"]="/opt/MyApps/tools/lib"
config.status:S["DisplayDelegate"]="/opt/MyApps/tools/bin/display"
config.status:S["SHARE_CONFIGURE_PATH"]="/opt/MyApps/tools/share/ImageMagick-6.6.3/config"
config.status:S["SHARE_PATH"]="/opt/MyApps/tools/share/ImageMagick-6.6.3"
config.status:S["DOCUMENTATION_PATH"]="/opt/MyApps/tools/share/doc/ImageMagick-6.6.3"
config.status:S["FILTER_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters"
config.status:S["CODER_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders"
config.status:S["CONFIGURE_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/"
config.status:S["LIBRARY_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3"
config.status:S["EXECUTABLE_PATH"]="/opt/MyApps/tools/bin"
config.status:S["MAN_DIR"]="/opt/MyApps/tools/share/man"
config.status:S["INFO_DIR"]="/opt/MyApps/tools/share/info"
config.status:S["INCLUDE_DIR"]="/opt/MyApps/tools/include"
config.status:S["LIB_DIR"]="/opt/MyApps/tools/lib"
config.status:S["LOCALSTATE_DIR"]="/opt/MyApps/tools/var"
config.status:S["SHAREDSTATE_DIR"]="/opt/MyApps/tools/com"
config.status:S["SYSCONF_DIR"]="/opt/MyApps/tools/etc"
config.status:S["DATA_DIR"]="/opt/MyApps/tools/share"
config.status:S["LIBEXEC_DIR"]="/opt/MyApps/tools/libexec"
config.status:S["SBIN_DIR"]="/opt/MyApps/tools/sbin"
config.status:S["BIN_DIR"]="/opt/MyApps/tools/bin"
config.status:S["EXEC_PREFIX_DIR"]="/opt/MyApps/tools"
config.status:S["PREFIX_DIR"]="/opt/MyApps/tools"
config.status:S["CONFIGURE_ARGS"]="./configure  '--prefix=/opt/MyApps/tools' '--exec-prefix=/opt/MyApps/tools' '--without-perl' '--without-magick-plus-plus'"
config.status:S["prefix"]="/opt/MyApps/tools"
config.status:S["exec_prefix"]="/opt/MyApps/tools"
config.status:D["EXECUTABLE_PATH"]=" \"/opt/MyApps/tools/bin/\""
config.status:D["LIBRARY_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/\""
config.status:D["CONFIGURE_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/\""
config.status:D["CODER_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders/\""
config.status:D["FILTER_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters/\""
config.status:D["DOCUMENTATION_PATH"]=" \"/opt/MyApps/tools/share/doc/ImageMagick-6.6.3/\""
config.status:D["SHARE_PATH"]=" \"/opt/MyApps/tools/share/ImageMagick-6.6.3/\""
config.status:D["SHARE_CONFIGURE_PATH"]=" \"/opt/MyApps/tools/share/ImageMagick-6.6.3/config/\""


User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Custom RPM

Post by anthony »

silvex wrote:I am trying to create a custom RPM for ImageMagick-6.6.3-7. I am able to create the regular RPM, which installs under /. I need to create a different install path to /opt/applications/tools. I configured it with "configure --prefix=/opt/applications/tools --exec-prefix=/opt/applications/tools.

It does built the RPM but not using that prefix. It uses the / prefix.
Any 'configuraion' made when building a Source RPM are NOT included into the resulting RPM package.

The Image Magick sources generates a Source RPM, that includes the file "ImageMagick.spec"
which is generated from "ImageMagick.spec.in". The binary package RPM is generatign using that 'spec' file.

If you modify the configuration parameters in the "spec.in" file, and re-build the source RPM, then the RPMs build will then be modified accordingly. The configuration used to build the SRPM does not matter.

I myself apply a patch to the "ImageMagick.spec.in" file to add --with-autotrace to the RPM build configuation. Here is my 'diff' patch
http://dl.dropbox.com/u/9500683/ImageMa ... c.in.patch
Which I apply using the command

Code: Select all

patch -f < ImageMagick.spec.in.patch
in the SVN downloaded source area.

I also patch the "Makefile.in" file so that it only creates a "tar.bz2" copy of the source for inclusion into the generated SRPM file. The other archives (build by default) are not actually needed on for fedora RPM's. Here is the makefile patch I use....
http://dl.dropbox.com/u/9500683/Makefile.in.patch


NOTE that as these files patch 'in' files, the patches much be applied before the normal "configure" command.

And I do recommend you create a patch and save it somewhere else, so that you can re-download the sources completely on occasion, and then re-apply the patch, before
making the new RPMs.

I have a script to do all this for my own personal ImageMagick installes. Actually three IM installs... system install (using RPM's), HDRI (personal 'uninstalled' version), and a test bed for programming, in the sources directory itself) completely automate the process.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
silvex

Re: Custom RPM

Post by silvex »

Anthony, thanks for the info. I was trying a similar approach. Would it make sense to edit the ImageMagick.spec.in BEFORE the configure?
silvex

Re: Custom RPM

Post by silvex »

This is a snipped after rebuilding the srpm and doing a "rpmbuild -v --nodeps -vv SPECS/ImageMagick.spec" under /usr/src/packages

Code: Select all

Options used to compile and link:
  PREFIX          = /opt/MyApps/tools
  EXEC-PREFIX     = /opt/MyApps/tools
  VERSION         = 6.6.3
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -Wall -pthread
  CPPFLAGS        = -I/usr/include/ImageMagick
  PCFLAGS         =
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         = -L/usr/X11R6/lib64
  MAGICK_LDFLAGS  = -L/usr/lib64 -L/usr/X11R6/lib64
  LIBS            = -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lpthread -lltdl
  CXX             = g++
  CXXFLAGS        = -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -pthread
  FEATURES        =

It stil install under /usr
silvex

Re: Custom RPM

Post by silvex »

I just untar ImageMagick
edited ImageMagick.spec.to add the --prefix and --exec-prefix "/opt/MyApps/tools"
did a "./configure --prefix=/opt/MyApps/tool --exec-prefix=/opt/MyApps/tools"
did make srpm
did a rpmbuild --nodeps --rebuild ImageMagick*.src.rpm
now

from grep MyApps *

Code: Select all

ImageMagick.spec:%configure --prefix=/opt/MyApps/tools \
ImageMagick.spec:           --exec-prefix=/opt/MyApps/tools \
ImageMagick.spec.in:%configure --prefix=/opt/MyApps/tools \
ImageMagick.spec.in:           --exec-prefix=/opt/MyApps/tools \
Makefile:BIN_DIR = /opt/MyApps/tools/bin
Makefile:CODER_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders
Makefile:CONFIGURE_ARGS = ./configure  '--prefix=/opt/MyApps/tools' '-exec-prefix=/opt/MyApps/tools'
Makefile:CONFIGURE_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/config/
Makefile:DATA_DIR = /opt/MyApps/tools/share
Makefile:DOCUMENTATION_PATH = /opt/MyApps/tools/share/doc/ImageMagick-6.6.3
Makefile:DisplayDelegate = /opt/MyApps/tools/bin/display
Makefile:EXECUTABLE_PATH = /opt/MyApps/tools/bin
Makefile:EXEC_PREFIX_DIR = /opt/MyApps/tools
Makefile:FILTER_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters
Makefile:INCLUDE_DIR = /opt/MyApps/tools/include
Makefile:INFO_DIR = /opt/MyApps/tools/share/info
Makefile:LIBEXEC_DIR = /opt/MyApps/tools/libexec
Makefile:LIBRARY_PATH = /opt/MyApps/tools/lib/ImageMagick-6.6.3
Makefile:LIB_DIR = /opt/MyApps/tools/lib
Makefile:LOCALSTATE_DIR = /opt/MyApps/tools/var
Makefile:MAGICKCORE_PATH = /opt/MyApps/tools/lib
Makefile:MAGICK_CPPFLAGS = -I/opt/MyApps/tools/include/ImageMagick
Makefile:MAGICK_LDFLAGS = -L/opt/MyApps/tools/lib -L/usr/X11R6/lib64
Makefile:MAN_DIR = /opt/MyApps/tools/share/man
Makefile:PREFIX_DIR = /opt/MyApps/tools
Makefile:SBIN_DIR = /opt/MyApps/tools/sbin
Makefile:SHAREDSTATE_DIR = /opt/MyApps/tools/com
Makefile:SHARE_CONFIGURE_PATH = /opt/MyApps/tools/share/ImageMagick-6.6.3/config
Makefile:SHARE_PATH = /opt/MyApps/tools/share/ImageMagick-6.6.3
Makefile:SYSCONF_DIR = /opt/MyApps/tools/etc
Makefile:exec_prefix = /opt/MyApps/tools
Makefile:prefix = /opt/MyApps/tools
config.log:  $ ./configure --prefix=/opt/MyApps/tools -exec-prefix=/opt/MyApps/tools
config.log:  PREFIX          = /opt/MyApps/tools
config.log:  EXEC-PREFIX     = /opt/MyApps/tools
config.log:  CPPFLAGS        = -I/opt/MyApps/tools/include/ImageMagick
config.log:  MAGICK_LDFLAGS  = -L/opt/MyApps/tools/lib -L/usr/X11R6/lib64
config.log:BIN_DIR='/opt/MyApps/tools/bin'
config.log:CODER_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders'
config.log:CONFIGURE_ARGS='./configure  '\''--prefix=/opt/MyApps/tools'\'' '\''-exec-prefix=/opt/MyApps/tools'\'''
config.log:CONFIGURE_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/'
config.log:DATA_DIR='/opt/MyApps/tools/share'
config.log:DOCUMENTATION_PATH='/opt/MyApps/tools/share/doc/ImageMagick-6.6.3'
config.log:DisplayDelegate='/opt/MyApps/tools/bin/display'
config.log:EXECUTABLE_PATH='/opt/MyApps/tools/bin'
config.log:EXEC_PREFIX_DIR='/opt/MyApps/tools'
config.log:FILTER_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters'
config.log:INCLUDE_DIR='/opt/MyApps/tools/include'
config.log:INFO_DIR='/opt/MyApps/tools/share/info'
config.log:LIBEXEC_DIR='/opt/MyApps/tools/libexec'
config.log:LIBRARY_PATH='/opt/MyApps/tools/lib/ImageMagick-6.6.3'
config.log:LIB_DIR='/opt/MyApps/tools/lib'
config.log:LOCALSTATE_DIR='/opt/MyApps/tools/var'
config.log:MAGICKCORE_PATH='/opt/MyApps/tools/lib'
config.log:MAGICK_CPPFLAGS='-I/opt/MyApps/tools/include/ImageMagick'
config.log:MAGICK_LDFLAGS='-L/opt/MyApps/tools/lib -L/usr/X11R6/lib64'
config.log:MAN_DIR='/opt/MyApps/tools/share/man'
config.log:PREFIX_DIR='/opt/MyApps/tools'
config.log:SBIN_DIR='/opt/MyApps/tools/sbin'
config.log:SHAREDSTATE_DIR='/opt/MyApps/tools/com'
config.log:SHARE_CONFIGURE_PATH='/opt/MyApps/tools/share/ImageMagick-6.6.3/config'
config.log:SHARE_PATH='/opt/MyApps/tools/share/ImageMagick-6.6.3'
config.log:SYSCONF_DIR='/opt/MyApps/tools/etc'
config.log:exec_prefix='/opt/MyApps/tools'
config.log:prefix='/opt/MyApps/tools'
config.log:#define EXECUTABLE_PATH "/opt/MyApps/tools/bin/"
config.log:#define LIBRARY_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/"
config.log:#define CONFIGURE_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/"
config.log:#define CODER_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders/"
config.log:#define FILTER_PATH "/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters/"
config.log:#define DOCUMENTATION_PATH "/opt/MyApps/tools/share/doc/ImageMagick-6.6.3/"
config.log:#define SHARE_PATH "/opt/MyApps/tools/share/ImageMagick-6.6.3/"
config.log:#define SHARE_CONFIGURE_PATH "/opt/MyApps/tools/share/ImageMagick-6.6.3/config/"
config.status:ac_cs_config="'--prefix=/opt/MyApps/tools' '-exec-prefix=/opt/MyApps/tools' --enable-ltdl-convenience"
config.status:  set X '/bin/sh' './configure'  '--prefix=/opt/MyApps/tools' '-exec-prefix=/opt/MyApps/tools' --enable-ltdl-convenience $ac_configure_extra_args --no-create --no-recursion
config.status:S["MAGICK_LDFLAGS"]="-L/opt/MyApps/tools/lib -L/usr/X11R6/lib64"
config.status:S["MAGICK_CPPFLAGS"]="-I/opt/MyApps/tools/include/ImageMagick"
config.status:S["MAGICKCORE_PATH"]="/opt/MyApps/tools/lib"
config.status:S["DisplayDelegate"]="/opt/MyApps/tools/bin/display"
config.status:S["SHARE_CONFIGURE_PATH"]="/opt/MyApps/tools/share/ImageMagick-6.6.3/config"
config.status:S["SHARE_PATH"]="/opt/MyApps/tools/share/ImageMagick-6.6.3"
config.status:S["DOCUMENTATION_PATH"]="/opt/MyApps/tools/share/doc/ImageMagick-6.6.3"
config.status:S["FILTER_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters"
config.status:S["CODER_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders"
config.status:S["CONFIGURE_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/"
config.status:S["LIBRARY_PATH"]="/opt/MyApps/tools/lib/ImageMagick-6.6.3"
config.status:S["EXECUTABLE_PATH"]="/opt/MyApps/tools/bin"
config.status:S["MAN_DIR"]="/opt/MyApps/tools/share/man"
config.status:S["INFO_DIR"]="/opt/MyApps/tools/share/info"
config.status:S["INCLUDE_DIR"]="/opt/MyApps/tools/include"
config.status:S["LIB_DIR"]="/opt/MyApps/tools/lib"
config.status:S["LOCALSTATE_DIR"]="/opt/MyApps/tools/var"
config.status:S["SHAREDSTATE_DIR"]="/opt/MyApps/tools/com"
config.status:S["SYSCONF_DIR"]="/opt/MyApps/tools/etc"
config.status:S["DATA_DIR"]="/opt/MyApps/tools/share"
config.status:S["LIBEXEC_DIR"]="/opt/MyApps/tools/libexec"
config.status:S["SBIN_DIR"]="/opt/MyApps/tools/sbin"
config.status:S["BIN_DIR"]="/opt/MyApps/tools/bin"
config.status:S["EXEC_PREFIX_DIR"]="/opt/MyApps/tools"
config.status:S["PREFIX_DIR"]="/opt/MyApps/tools"
config.status:S["CONFIGURE_ARGS"]="./configure  '--prefix=/opt/MyApps/tools' '-exec-prefix=/opt/MyApps/tools'"
config.status:S["prefix"]="/opt/MyApps/tools"
config.status:S["exec_prefix"]="/opt/MyApps/tools"
config.status:D["EXECUTABLE_PATH"]=" \"/opt/MyApps/tools/bin/\""
config.status:D["LIBRARY_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/\""
config.status:D["CONFIGURE_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/config/\""
config.status:D["CODER_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/coders/\""
config.status:D["FILTER_PATH"]=" \"/opt/MyApps/tools/lib/ImageMagick-6.6.3/modules-Q16/filters/\""
config.status:D["DOCUMENTATION_PATH"]=" \"/opt/MyApps/tools/share/doc/ImageMagick-6.6.3/\""
config.status:D["SHARE_PATH"]=" \"/opt/MyApps/tools/share/ImageMagick-6.6.3/\""
config.status:D["SHARE_CONFIGURE_PATH"]=" \"/opt/MyApps/tools/share/ImageMagick-6.6.3/config/\""


and still installs under /usr !!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Custom RPM

Post by anthony »

silvex wrote:Anthony, thanks for the info. I was trying a similar approach. Would it make sense to edit the ImageMagick.spec.in BEFORE the configure?
You have to as it is configure that converts ImageMagick.spec.in to ImageMagick.spec
If you configure first than you need to patch ImageMagick.spec
You also then need to re-do that patch every time you configure!

Better to patch the 'in' files and then run configure.

The makefile patch is simply to speed up RPM generation, and greatly reduce disk usage, by simply not generating the other source archives not involved with SRPM generation.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Custom RPM

Post by anthony »

silvex wrote:still installs under /usr !!
Sorry, I have not tried to create a RPM with a different prefix.

The %configure changes should cause IM to install its files into the 'fake root' that "rpmbuild" creates to generate the RPM package.

Unless "rpmbuild" itself is overriding things, I really don't know that much about how "rpmbuild" works internally.

Hmmm in %install section of the Spec is the lines...
%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{VERSION}
rm $RPM_BUILD_ROOT%{_libdir}/*.la
This may be where "rpmbuild" is overriding "configure" settings. 8)
You may also like to consider removing or modifying the "cp" command to not include the /usr/share/doc documentation for your 'moved' version of ImageMagick.


NOTE: the RPM package you generated may have installed in /usr but it was probably configured for the location you wanted, just wasn't installed in the right location! :-(
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
silvex

Re: Custom RPM

Post by silvex »

Anthony,
that is correct. It seems like it does matter where the "root" for the RPM is always defaults to /usr/local. I even hard coded the configure to be "my root" and it does create the Makefile with it. The thing is that when doing a "make rpm" or "make srpm". It Creates a Makefile overring "my root" settings. The only time the "my root" works. Is when doing a "configure --prefix=/myroot" "make" "make install".

So what I did was just that. I then created a tarball and made a custom spec file with the tar ball.

I think they have a bug with --prefix in the configure.

Code: Select all

:~/src/ImageMagick-6.6.3-7 # grep ac_default_prefix *
configure:ac_default_prefix=/usr/local <<< I hard coded my path here and no luck!
configure:                          [$ac_default_prefix]
configure:\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
configure:an installation prefix other than \`$ac_default_prefix' using \`--prefix',
configure:  ac_site_file1=$ac_default_prefix/share/config.site
configure:  ac_site_file2=$ac_default_prefix/etc/config.site
configure:    prefix=$ac_default_prefix
configure:test "x$prefix" = xNONE && prefix=$ac_default_prefix
configure.ac:    prefix=$ac_default_prefix

silvex

Re: Custom RPM

Post by silvex »

The Makefile it generates under rpmbuild/BUILD/ seems to be the issue. It has two --prefix and it re-codes ALL path such as /bin /usr/bin etc etc.

Code: Select all

CONFIGURE_ARGS = ./configure  '--host=x86_64-suse-linux' '--build=x86_64-suse-linux' '--target=x86_64-suse-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/lib64' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/opt/MyApps/tools' '--exec-prefix=/opt/MyApps/tools' '--enable-shared' '--disable-static' '--with-modules' '--with-perl' '--with-x' '--with-threads' '--with-magick_plus_plus' '--with-gslib' '--with-wmf' '--with-lcms' '--with-rsvg' '--with-xml' '--with-perl-options=INSTALLDIRS=vendor /var/tmp/ImageMagick-6.6.3-7-root-root CC='\''gcc -L/root/src/ImageMagick-6.6.3-7/rpmbuild/BUILD/ImageMagick-6.6.3-7/magick/.libs'\'' LDDLFLAGS='\''-shared -L/root/src/ImageMagick-6.6.3-7/rpmbuild/BUILD/ImageMagick-6.6.3-7/magick/.libs'\''' '--without-dps' '--without-included-ltdl' '--with-ltdl-include=/usr/include' '--with-ltdl-lib=/usr/lib64' 'build_alias=x86_64-suse-linux' 'host_alias=x86_64-suse-linux' 'target_alias=x86_64-suse-linux' 'CFLAGS=-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2'

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Custom RPM

Post by anthony »

silvex wrote:The Makefile it generates under rpmbuild/BUILD/ seems to be the issue. It has two --prefix and it re-codes ALL path such as /bin /usr/bin etc etc.

Code: Select all

CONFIGURE_ARGS = ./configure  ....   '--prefix=/usr'  ....  '--prefix=/opt/MyApps/tools' ....
Hmm yes two prefixes, and a swag of other 'standard' configure options. The Makefile entry is just a copy of the call to the configure command that rpmbuild issued.

The solution then will NOT be adding a -prefix to the %configure section of rpmbuild.
Instead we need to some how tell rpmbuild what the 'root' of the install should be.

This may either be some other Spec file option, or perhaps a rpmbuild option.

Hmmm A little research...
We need to somehow override the %{_prefix} variable of rpmbuild.
Currently...

Code: Select all

   rpmbuild --showrc | grep prefix
...
-14: _prefix /usr
...
Try this...
Remove any prefix you added from the Spec and then build the RPM from SRPM using...

Code: Select all

   rpmbuild --define="_prefix /opt/MyApps/ImageMagick"  ...
or whatever. If this works it should install everything into sub-directories of that directory
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
silvex

Re: Custom RPM

Post by silvex »

I tried the --define "_prefix /opt/MyApps" and did not work. I think the configure script needs updating. Where can I file a bug ?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Custom RPM

Post by anthony »

silvex wrote:I tried the --define "_prefix /opt/MyApps" and did not work. I think the configure script needs updating. Where can I file a bug ?
I don't think it is a bug, we just need a better understanding on how to modify rpmbuild and the RPM Spec file to use a different install "prefix".

My suggestion was a guess on my part. It may be you need to re-define every 'prefix' related variable with that method.

I would suggest you ask on one of the linux forums, especially one dealing with RPM's.

Whatever the outcome, let me know.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply