Hi,
I have been building wine RPMs for some time now.
The way I do is to specify the correct paths to ./configure script (like prefix, mandir, bindir, ...).
After building I have to use an ugly make install in orther to install it into another dir that is different from the one.
However, talking to some wine developers on #winehq in openprojects network. They state that a ./configure --prefix=<you buildroot>/prefix
was enough. That's because wine does not hardcode any %prefix related path. This would simplify a lot the process.
However I just checked that wine does hardcode the %prefix dir in the binaries.
This is done in dlls/ntdll/ntdll.dll.so and possible at miscemu/wine .
AFAIU, this is done to keep the path to the global registries which is the Right Thing to do.
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
Is there any chance to get a DESTDIR implemented in the Makefiles?
[]'s Raul Dias
Raul Dias chaos@swi.com.br writes:
After building I have to use an ugly make install in orther to install it into another dir that is different from the one.
What's so ugly about that make install? Could you show us the commands you are using?
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
Is there any chance to get a DESTDIR implemented in the Makefiles?
Sure, if there is a good reason for it.
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
After building I have to use an ugly make install in orther to install it into another dir that is different from the one.
What's so ugly about that make install? Could you show us the commands you are using?
make \ prefix=%{buildroot}%{_prefix} \ bindir=%{buildroot}%{_bindir} \ libdir=%{buildroot}%{_libdir} \ mandir=%{buildroot}%{_mandir} \ dlldir=%{buildroot}%{_libdir}/%{name} \ includedir=%{buildroot}/%{_includedir}/%{name} \ datadir=%{buildroot}/%{_datadir} \ LDCONFIG=/bin/true \ install
just notice that I build as a non-root user. %{...} are macros expanded to path names.
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
just setting the prefix in the make install won't work.
Is there any chance to get a DESTDIR implemented in the Makefiles?
Sure, if there is a good reason for it.
I hope that this is :)
[]'s Raul Dias
On Wed, 14 Aug 2002, Raul Dias wrote:
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
just setting the prefix in the make install won't work.
It works for my Debian packages with just prefix and libdir:
$(MAKE) install prefix=`pwd`/debian/tmp/usr libdir=`pwd`/debian/tmp/usr/lib
Ove Kaaven ovehk@ping.uio.no wrote:
On Wed, 14 Aug 2002, Raul Dias wrote:
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
just setting the prefix in the make install won't work.
It works for my Debian packages with just prefix and libdir:
$(MAKE) install prefix=`pwd`/debian/tmp/usr libdir=`pwd`/debian/tmp/usr/lib
Are you sure? here I get:
[chaos@speedy wine-20020804]$ make prefix=/var/tmp/wine_root/usr libdir=/var/tmp/wine_root/usr/lib install
cd `dirname include/__install__` && make install make[1]: Entering directory `/chaos/rpm/BUILD/wine-20020804/include' ../tools/mkinstalldirs /usr/include/wine/wine /usr/include/wine/wine/wine /usr/include/wine/wine/msvcrt /usr/include/wine/wine/msvcrt/sys mkdir -p -- /usr/include/wine/wine/wine /usr/include/wine/wine/msvcrt /usr/include/wine/wine/msvcrt/sys mkdir: cannot create directory `/usr/include/wine/wine/wine': Permiss�o negada mkdir: cannot create directory `/usr/include/wine/wine/msvcrt': Permiss�o negada mkdir: cannot create directory `/usr/include/wine/wine/msvcrt': Permiss�o negada make[1]: *** [install] Error 1 make[1]: Leaving directory `/chaos/rpm/BUILD/wine-20020804/include' make: *** [include/__install__] Error 2
Please not that if this has being done as root, the problem wouldn't be notices (as root may write in /usr/include).
On Wed, 14 Aug 2002, Raul Dias wrote:
Ove Kaaven ovehk@ping.uio.no wrote:
On Wed, 14 Aug 2002, Raul Dias wrote:
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
just setting the prefix in the make install won't work.
It works for my Debian packages with just prefix and libdir:
$(MAKE) install prefix=`pwd`/debian/tmp/usr libdir=`pwd`/debian/tmp/usr/lib
Are you sure?
OK, perhaps it has something to do with my configure invocation.
CFLAGS="$(CFLAGS)" ./configure --with-x --enable-opengl --prefix=/usr --sysconfdir=/etc \ --libdir=$${prefix}/lib --mandir=$${prefix}/share/man --infodir=$${prefix}/share/info
Ove Kaaven ovehk@ping.uio.no wrote:
On Wed, 14 Aug 2002, Raul Dias wrote:
Ove Kaaven ovehk@ping.uio.no wrote:
On Wed, 14 Aug 2002, Raul Dias wrote:
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
So what I really would like to know is which way is the right way to install wine in a dir different than %prefix or /usr/local (default %prefix)?
The right way is to run configure with the final prefix, run make, and then run make install with the prefix set to the package build location.
just setting the prefix in the make install won't work.
It works for my Debian packages with just prefix and libdir:
$(MAKE) install prefix=`pwd`/debian/tmp/usr libdir=`pwd`/debian/tmp/usr/lib
Are you sure?
OK, perhaps it has something to do with my configure invocation.
CFLAGS="$(CFLAGS)" ./configure --with-x --enable-opengl --prefix=/usr --sysconfdir=/etc \ --libdir=$${prefix}/lib --mandir=$${prefix}/share/man --infodir=$${prefix}/share/info
That's it!
configure is called with rpm location macros as:
./configure --prefix=%{_prefix} --libdir=%{_libdir} and so on
that is expanded to:
./configure --prefix=/usr --libdir=/usr/lib ....
In turn this variables won't rely on ${prefix} in Makefile.
Actually, this is the desirable situation in rpm as to change a path, you just have to change the macro without reworking the specfile.
This is also the reason why most application does have a DESTDIR variable in the makefiles. This way they don't have to rely on the prefix variable to install on different location.
Alexandre, Do you think this reason is good enough to consider DESTDIR support in wine?
[]'s Raul Dias
Raul Dias chaos@swi.com.br writes:
configure is called with rpm location macros as:
./configure --prefix=%{_prefix} --libdir=%{_libdir} and so on
that is expanded to:
./configure --prefix=/usr --libdir=/usr/lib ....
In turn this variables won't rely on ${prefix} in Makefile.
But %{_libdir} should expand to ${prefix}/lib, not /usr/lib. Otherwise you can't change prefix and have it do anything useful. Is this something you can fix, or are the _libdir etc. macros hardcoded?
Le jeu 15/08/2002 à 15:14, Alexandre Julliard a écrit :
Raul Dias chaos@swi.com.br writes:
configure is called with rpm location macros as:
./configure --prefix=%{_prefix} --libdir=%{_libdir} and so on
that is expanded to:
./configure --prefix=/usr --libdir=/usr/lib ....
In turn this variables won't rely on ${prefix} in Makefile.
But %{_libdir} should expand to ${prefix}/lib, not /usr/lib. Otherwise you can't change prefix and have it do anything useful. Is this something you can fix, or are the _libdir etc. macros hardcoded?
They're not hardcoded (at least on my system, RH7.3 with rpm-4.0.4-7x.18). In fact, they are defined in /usr/lib/rpm/(arch)-linux/macros, and except for _sysconfdir, _localstatedir et _oldincludedir, they all rely on other macros to update themselves should you choose another _prefix.
Raul, another way you could install while doing the RPM is via the %makeinstall macro rather than a manual "make install". Same thing applies to %configure vs "./configure". All the dirs are already given, and as a bonus, your spec file will be smaller and more easily manageable.
FYI, the format of the directory passing of the %makeinstall macro is make prefix=%(?buildroot:%{buildroot}}%{_prefix} ... install, which is close to what you had originally.
I believe using those %configure and %makeinstall macros are the proper way to use rpm nowadays.
Vincent
hi Vicent,
Vincent =?ISO-8859-1?Q?B=E9ron?= vberon@mecano.gme.usherb.ca wrote:
Le jeu 15/08/2002 � 15:14, Alexandre Julliard a �crit :
Raul Dias chaos@swi.com.br writes:
configure is called with rpm location macros as:
./configure --prefix=%{_prefix} --libdir=%{_libdir} and so on
that is expanded to:
./configure --prefix=/usr --libdir=/usr/lib ....
In turn this variables won't rely on ${prefix} in Makefile.
But %{_libdir} should expand to ${prefix}/lib, not /usr/lib. Otherwise you can't change prefix and have it do anything useful. Is this something you can fix, or are the _libdir etc. macros hardcoded?
They're not hardcoded (at least on my system, RH7.3 with rpm-4.0.4-7x.18). In fact, they are defined in /usr/lib/rpm/(arch)-linux/macros, and except for _sysconfdir, _localstatedir et _oldincludedir, they all rely on other macros to update themselves should you choose another _prefix.
right.
Raul, another way you could install while doing the RPM is via the %makeinstall macro rather than a manual "make install". Same thing applies to %configure vs "./configure". All the dirs are already given, and as a bonus, your spec file will be smaller and more easily manageable.
Would be it, but %makeinstall does not handle dlldir.
FYI, the format of the directory passing of the %makeinstall macro is make prefix=%(?buildroot:%{buildroot}}%{_prefix} ... install, which is close to what you had originally.
I believe using those %configure and %makeinstall macros are the proper way to use rpm nowadays.
true.
But changing them for every app is not the Right Thing. What I want to show is that other applications solve this very problem by using DESTDIR.
%configure and %makeinstall is fresh in rpm world (about 2 years).
[]'s Raul Dias
Vincent
Raul Dias chaos@swi.com.br writes:
I believe using those %configure and %makeinstall macros are the proper way to use rpm nowadays.
true.
But changing them for every app is not the Right Thing. What I want to show is that other applications solve this very problem by using DESTDIR.
But there is no problem to solve AFAICS. I haven't seen anything yet that you can do with DESTDIR that you cannot do with the existing prefix mechanism. The only real problem is that the rpm macros apparently break the prefix stuff; but then it's the responsibility of the rpm tools to provide a work around (which is what %makeinstall is).
Le mer 14/08/2002 à 18:47, Raul Dias a écrit :
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
After building I have to use an ugly make install in orther to install it into another dir that is different from the one.
What's so ugly about that make install? Could you show us the commands you are using?
make \ prefix=%{buildroot}%{_prefix} \ bindir=%{buildroot}%{_bindir} \ libdir=%{buildroot}%{_libdir} \ mandir=%{buildroot}%{_mandir} \ dlldir=%{buildroot}%{_libdir}/%{name} \ includedir=%{buildroot}/%{_includedir}/%{name} \ datadir=%{buildroot}/%{_datadir} \ LDCONFIG=/bin/true \ install
just notice that I build as a non-root user. %{...} are macros expanded to path names.
The paths for prefix, bindir, libdir, mandir and dlldir don't have a slash between the $(buildroot) and %(_somethingelse) parts, while the includedir and datadir do. Could you check which one is the right way to go? (Or if it doesn't change anything?)
Else, from an old (20020614) install log that I had laying around, you seem to have covered all the necessary directories. In addition to what I already said, you can also define exec_prefix (default is same thing as prefix), infodir ($(prefix)/info) and sysconfdir ($(prefix)/etc).
Question regarding the installation process: in the Makefiles, all the directories (except prefix) are defined wrt prefix. Shouldn't setting prefix at installation time should be enough then?
Answer: yes, setting only prefix= at installation time works (at least with the 20020614 source I had), and all the other directories under it are created correctly. Maybe something changed since then in the installation process.
Vincent
Vincent =?ISO-8859-1?Q?B=E9ron?= vberon@mecano.gme.usherb.ca wrote:
Le mer 14/08/2002 � 18:47, Raul Dias a �crit :
Alexandre Julliard julliard@winehq.com wrote:
Raul Dias chaos@swi.com.br writes:
After building I have to use an ugly make install in orther to install it into another dir that is different from the one.
What's so ugly about that make install? Could you show us the commands you are using?
make \ prefix=%{buildroot}%{_prefix} \ bindir=%{buildroot}%{_bindir} \ libdir=%{buildroot}%{_libdir} \ mandir=%{buildroot}%{_mandir} \ dlldir=%{buildroot}%{_libdir}/%{name} \ includedir=%{buildroot}/%{_includedir}/%{name} \ datadir=%{buildroot}/%{_datadir} \ LDCONFIG=/bin/true \ install
just notice that I build as a non-root user. %{...} are macros expanded to path names.
The paths for prefix, bindir, libdir, mandir and dlldir don't have a slash between the $(buildroot) and %(_somethingelse) parts, while the includedir and datadir do. Could you check which one is the right way to go? (Or if it doesn't change anything?)
the %{_macros} does have the / in the beginning.
Else, from an old (20020614) install log that I had laying around, you seem to have covered all the necessary directories. In addition to what I already said, you can also define exec_prefix (default is same thing as prefix), infodir ($(prefix)/info) and sysconfdir ($(prefix)/etc).
the ones above are the necessary ones, at least for now. I know this by doing a "make install" and adding the ones needed as error shows up (like the includedir one).
Question regarding the installation process: in the Makefiles, all the directories (except prefix) are defined wrt prefix. Shouldn't setting prefix at installation time should be enough then?
Not for me at least. Here is how things are in my Makefile:
[chaos@speedy wine-20020804]$ grep dlldir Makefile -B 9 prefix = /usr exec_prefix = /usr bindir = /usr/bin libdir = /usr/lib datadir = /usr/share infodir = /usr/share/info mandir = /usr/share/man sysconfdir = /etc/wine includedir = /usr/include/wine/wine dlldir = /usr/lib/wine
Answer: yes, setting only prefix= at installation time works (at least with the 20020614 source I had), and all the other directories under it are created correctly. Maybe something changed since then in the installation process.
as I showed before, it doesn't (at least for me).
[]'s Raul Dias