Compiling YaST2 in Debian

Revision History
Revision 0.318 / 03 / 05Revised by: R.A
Corrected some typos and important fixes (we use libstdc++5 instead of libstdc++6). Added process until getting yast2-users working.
Revision 0.213 / 03 / 05Revised by: R.A
Rewritten from the original with DocBook and with some pikota's remarks (Thanks Jose Luis!).

This article documents how to compile yast2-core under Debian.


Table of Contents
1. Installation of some necessary programs
2. SuSE's rpm compilation
3. yast2-devtools compilation
4. liby2util compilation
5. yast2-packagemanager compilation
6. hwinfo
7. yast2-core compilation
8. yast2-testsuite compilation
9. yast2 compilation
10. yast2-ncurses compilation
11. First try
12. yast2-perl-bindings
13. yast2-pam
14. yast2-security
15. First useful module: yast2-users
16. Conclusions

1. Installation of some necessary programs

We have to install some packages before we begin:


ramon@pangeadm:~/$ apt-get install libxml-writer-perl dejagnu flex-old doxygen electric-fence \
libslp-dev libcurl3-dev libstdc++5 libsysfs-dev  checkinstall
		

2. SuSE's rpm compilation

We need the Debian rpm to extract it and some additional packages so that getting it compiled:


ramon@pangeadm:~/$ apt-get install rpm bzip2 libelfg0
		

Download and extract the rpm


ramon@pangeadm:~/$ wget	ftp://ftp.suse.com/pub/suse/i386/9.2/suse/src/rpm-4.1.1-191.src.rpm
ramon@pangeadm:~/$ rpm2cpio rpm-4.1.1-191.src.rpm | cpio -
		

Now let's patch. In the .spec file we can see the order in which patches should be applied.


ramon@pangeadm:~/$ grep ^Patch ../rpm.spec
Patch:        rpm-4.1.1.diff
Patch1:       rpmqpack.diff
Patch2:       rpm-4.1.1-findlang.diff
Patch3:       ia64-asm.patch
Patch4:       rpm-4.1.1-fdleak.diff
Patch6:       rpm-4.1.1-hppa.diff
Patch7:       rpm-4.1.1-ice.diff
Patch8:       rpm-4.1.1-ppc-no-mfspr_jmpbuf.diff
Patch9:       lvalue.diff
Patch11:      brp-compress.diff
		

Extract the .tar.gz and start patching:


ramon@pangeadm:~/$ patch -p0 < ../patch.diff
		

Now we can start the compilation process. First we configure it to live under /usr:


pangeadm:~/YaST4Debian/src.rpm/rpm/rpm-4.1.1# ./configure --prefix=/usr
		

And some more packages to install:


apt-get install python2.3-dev libltdl3-dev libelfg0 libdwarf-dev
		

Remove the -Werror option from the Makefiles under elfutils/lib*/Makefile and elfutils/test/Makefile. Some of the Makefiles are created while compiling. If we get errors comming from a line containing -Werror we have to remove them again. This simple grep will allow you to detect them:


grep Werror elfutils/*/Makefile
		

Now it needs some files, let's give it them:

	
pangeadm:~/YaST4Debian/src.rpm/rpm/rpm-4.1.1# touch po/mkinstalldirs elfutils/po/mkinstalldirs
		

It looks for the headers of Python2.3 and a dwarf.h under /usr/local/include so we make them available there and start compiling:


ramon@pangeadm:~/$ ln -s /usr/include/python2.3/* /usr/include
ramon@pangeadm:~/$ ln -s /usr/include/libdwarf/dwarf.h  /usr/local/include/
pangeadm:~/YaST4Debian/src.rpm/rpm/rpm-4.1.1# make
pangeadm:~/YaST4Debian/src.rpm/rpm/rpm-4.1.1# checkinstall
		

Notecheckinstall and mkinstalldirs
 

If you get in troubles at make time modifying the Makefile as I show bellow may solve them:

MKINSTALLDIRS = $(top_builddir)/./mkinstalldirs

Notecheckinstall and dpkg
 

At the end checkinstall will try to install the Debian package it has created and it may conflict with the Debian rpm package. Just remove it and install by hand:


apt-get remove rpm librpm4 libpopt0
dpkg -i rpm-4.1.1_4.1.1-1_i386.deb
			

3. yast2-devtools compilation

Install the following packages:


#apt-get install sgmltools-lite linuxdoc-tools gettext g++
		

Download and extract the package:


ramon@pangeadm:~/$ wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-devtools-2.9.17.tar.bz2
		

And now let's compile:


ramon@pangeadm:~/YaST4Debian/src.rpm/yast2-devtools/yast2-devtools-2.9.17$ ./configure
ramon@pangeadm:~/YaST4Debian/src.rpm/yast2-devtools/yast2-devtools-2.9.17$ make
ramon@pangeadm:~/YaST4Debian/src.rpm/yast2-devtools/yast2-devtools-2.9.17$ checkinstall
		

4. liby2util compilation

Once again:


ramon@pangeadm:~/$ wget ftp://ftp.suse.com/pub/suse/i386/9.1/suse/src/liby2util-2.9.22-0.src.rpm
ramon@pangeadm:~/$ rpm2cpio liby2util-2.9.22-0.src.rpm | cpio - 
		

It requires libtool and automake1.6


pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# apt-get install libtool
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# apt-get install automake1.6
		

If we have automake1.4 installed we have to remove it.

Now we compile it with SuSE's y2tool help.


pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# ./configure
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# make
pangeadm:~/YaST4Debian/src.rpm/liby2util/liby2util-2.9.22# checkinstall
		

5. yast2-packagemanager compilation

Almost like before:


pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# y2tool autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# y2tool automake
pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# make
pangeadm:~/YaST4Debian/src.rpm/yast2-packagemanager/yast2-packagemanager-2.9.37# checkinstall
		

6. hwinfo

This is necessary to get yast2-core compiled:


pangeadm:~/YaST4Debian/src.rpm/hwinfo# wget ftp://ftp.suse.com/pub/suse/i386/9.1/suse/src/hwinfo-8.38-0.src.rpm
pangeadm:~/YaST4Debian/src.rpm/hwinfo# rpm2cpio hwinfo-9.31-1.1.src.rpm  |cpio -i
pangeadm:~/YaST4Debian/src.rpm/hwinfo/hwinfo-8.38# make
		

Now we have to copy libhd.a to /usr/lib and hd.h to /usr/include.


ramon@pangeadm:~/$ rpm2cpio hwinfo-9.31-1.1.src.rpm  |cpio -i
pangeadm:~/YaST4Debian/src.rpm/hwinfo/hwinfo-8.38# cp src/libhd.a /usr/lib
pangeadm:~/YaST4Debian/src.rpm/hwinfo/hwinfo-8.38# cp src/hd/hd.h /usr/include/
		

7. yast2-core compilation

Once again.


pangeadm:~/YaST4Debian/src.rpm/yast2-core# apt-get install bison ncurses-dev libxcrypt-dev
pangeadm:~/YaST4Debian/src.rpm/yast2-core# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-core-2.9.79.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79#  autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79# ./configure 
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79#  make
pangeadm:~/YaST4Debian/src.rpm/yast2-core/yast2-core-2.9.79#  checkinstall 
	

8. yast2-testsuite compilation


pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-testsuite-2.9.9.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite# tar xfj yast2-testsuite-2.9.9.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# make
pangeadm:~/YaST4Debian/src.rpm/yast2-testsuite/yast2-testsuite-2.9.9# checkinstall
	

9. yast2 compilation

And Finally the yast 2 package.


pangeadm:~/YaST4Debian/src.rpm/yast2# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-2.9.60.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2# tar xfj yast2-2.9.60.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# make
pangeadm:~/YaST4Debian/src.rpm/yast2/yast2-2.9.60# checkinstall
	

10. yast2-ncurses compilation

Come on, we almost have it:


pangeadm:~/YaST4Debian/src.rpm# apt-get install libncursesw5-dev
		

We need now a sid package so add an unstable/sid entry to your /etc/apt/sources.list before.


pangeadm:~/YaST4Debian/src.rpm# apt-get install libcurl3-dev
		

now modify in src/Makefile and testsuite/Makefile the following line:


INCLUDES = -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt
		

as shown:


INCLUDES = -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt -I$(oldincludedir)/ncursesw
		

And compile it.


pangeadm:~/YaST4Debian/src.rpm# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-ncurses-2.9.20.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# checkinstall
		

11. First try

You can try now out the first ncurses YaST2 on your Debian. Create the required log directory and try it.


pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# mkdir /var/log/YaST2/
pangeadm:~/YaST4Debian/src.rpm/yast2-ncurses/yast2-ncurses-2.9.20# yast
		

Impressed? well, that's nothing yet.

The first module we want to use is the yast2-users. To get it working we have to compile some other modules before.


12. yast2-perl-bindings


pangeadm:~/YaST4Debian/src.rpm# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-perl-bindings-2.9.25.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-perl-bindings/yast2-perl-bindings-2.9.25# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-perl-bindings/yast2-perl-bindings-2.9.25# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-perl-bindings/yast2-perl-bindings-2.9.25# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-perl-bindings/yast2-perl-bindings-2.9.25# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-perl-bindings/yast2-perl-bindings-2.9.25# checkinstall
		

13. yast2-pam


pangeadm:~/YaST4Debian/src.rpm# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-pam-2.9.10.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-pam/yast2-pam-2.9.10# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-pam/yast2-pam-2.9.10# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-pam/yast2-pam-2.9.10# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-pam/yast2-pam-2.9.10# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-pam/yast2-pam-2.9.10# checkinstall
		

14. yast2-security


pangeadm:~/YaST4Debian/src.rpm# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-security-2.9.14.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# make
pangeadm:~/YaST4Debian/src.rpm/yast2-security/yast2-security-2.9.14# checkinstall
		

15. First useful module: yast2-users

Let's try the first module that will show us that YaST2 can be that useful in Debian.


pangeadm:~/YaST4Debian/src.rpm# apt-get install cracklib2-dev
pangeadm:~/YaST4Debian/src.rpm# wget ftp://yast4debian.alioth.debian.org/pub/yast4debian/yast2-users-2.9.27.tar.bz2
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# /usr/bin/y2tool y2autoconf
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# /usr/bin/y2tool y2automake
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# autoreconf --force --install
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# ./configure
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# make
pangeadm:~/YaST4Debian/src.rpm/yast2-users/yast2-users-2.9.27# checkinstall
		

We are ready, let's try adding some users


16. Conclusions

If we succeeded now we can start compiling YaST2 modules and try to use them under Debian. Some modules are quite different and need a lot of hacking before using them under Debian (e.g: network configuring module) but others should be the same (e.g: users module).

If you want to contribute or you have comments about this article your feedback is allways welcome: ramon@linux-labs.net.