Compiling glib on CentOS

Do you get this error message while compiling glib on CentOS ?

checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

First, let’s check if libffi is installed:

[laurent@new-host]/usr/lib/pkgconfig> rpm -qa | grep libffi
libffi-3.0.5-3.2.el6.i686

[laurent@new-host]/> sudo find . -name *libffi*
./usr/share/doc/libffi-3.0.5
./usr/lib/libffi.so.5
./usr/lib/libffi.so.5.0.6
./var/lib/yum/yumdb/l/61825035e703e1d6d36e2c2f67e195b58eaf7475-libffi-3.0.5-3.2.el6-i686

OK, it is installed, so this certainly means that pkg-config doesn’t know about it. For more information concerning pkg-config, check this link.

 

[laurent@new-host]/usr/lib/pkgconfig> pkg-config --print-errors libffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found

OK: why am I missing the /usr/lib/pkgconfig/libffi.pc file ?

That’s because it’s part of the ‘libffi-devel’ package that is not installed by default !

Install it using yum and you’ll get everything you need:

[laurent@new-host]/usr/lib/pkgconfig> rpm -ql libffi-devel-3.0.5-3.2.el6.i686
/usr/lib/libffi-3.0.5
/usr/lib/libffi-3.0.5/include
/usr/lib/libffi-3.0.5/include/ffi.h
/usr/lib/libffi-3.0.5/include/ffitarget.h
/usr/lib/libffi.so
/usr/lib/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz

Laurent KUBASKI

Advertisements

Listing a Yum package content

First, let’s check if glib2 is installed:

[laurent@new-host]/usr/lib> yum list installed | grep glib2
glib2.i686 2.22.5-6.el6 @base/$releasever

OK, now what is the exact RPM package name for glib2 ?

[laurent@new-host]/usr/lib> rpm -qa | grep glib2
glib2-2.22.5-6.el6.i686

Great, let’s now see what is inside this RPM package:

[laurent@new-host]/usr/lib> rpm -ql glib2-2.22.5-6.el6.i686
/etc/profile.d/glib2.csh
/etc/profile.d/glib2.sh
/lib/libgio-2.0.so.0
/lib/libgio-2.0.so.0.2200.5
/lib/libglib-2.0.so.0
/lib/libglib-2.0.so.0.2200.5
/lib/libgmodule-2.0.so.0
/lib/libgmodule-2.0.so.0.2200.5
/lib/libgobject-2.0.so.0
/lib/libgobject-2.0.so.0.2200.5
/lib/libgthread-2.0.so.0
/lib/libgthread-2.0.so.0.2200.5
...

Laurent KUBASKI

Fixing the “non appearing files” issue when sharing files with SAMBA on CentOS

OK, I easily lost 8 hours trying to fix this issue:

  • installed SAMBA on CentOS
  • correctly configured smb.conf (security=user, writable=yes)
  • created a user account and declared it using smbpasswd
  • made sure that this user had full read/write access to the shared folder
  • made sure that the firewall was allowing SAMBA traffic

Then, from a Windows 7 PC, I used the ‘Map network drive” option, connected to my SAMBA shared drive, entered my SAMBA user name and password… and then what ?

  • only read-only access to the shared drive
  • only folders were visible, no files whatsoever

Do you know why ? Because SELinux is activated by default on CentOS.

To check if this is the case for you, use the ‘sestatus’ command: if you get an ‘enabled’ result, then you may want to disable it by following the procedure detailed here.

Laurent KUBASKI

Installing Gnome on CentOS and make it launch at boot


First install Gnome (use ALT F2 to switch to the shell if needed and 'loadkeys fr' if you want to change the default keyboard locale) : yum groupinstall "GNOME Desktop Environment"

Alternatively, do a 'yum grouplist' to see the list of groups and run for example 'yum groupinstall Desktop'

Then run 'startx' to make sure it starts.
Then edit /etc/inittab and replace the last line with id:5:initdefault:

Laurent KUBASKI