Posts Tagged ‘Linux’

Java 6 update 17 on Fedora 12

Friday, January 8th, 2010

A nice reader asked about the spec file for update 17 of the Sun Java virtual machine. I already had updated the spec file, which you can find here and then follow my previous post.
Right now, I am using Chromium (open source version of Google Chrome) and I will fix the Java plugin for that.
I Promise!

Pinax Dependencies – django-extensions

Monday, August 24th, 2009

Ok, so I checked Pinax dependencies and found some external libs to be packaged before being able to completely package Pinax. This packages will form the “depends” line of Pinax itself.

Looking carefully, the first one is named django_extensions, but really the name should be “django-extensions”, and you can find the project with the not intuitive name of “django-commandline-extensions” here at googlecode.

Ok, let’s see the spec file:

%{!?python_sitelib: %define python_sitelib %(%{__python} -c “from distutils.sysconfig import get_python_lib; print get_python_lib()”)}

Name:           django-extensions
Version:        0.4.1
Release:        1%{?dist}
Summary:        Django command line extensions

Up to this point, standard stuff. The {?dist} should stand for “current distribution”, so it will end in a “fc11″ package.

Group:          Development/Languages
License:        BSD
URL:            http://code.google.com/p/django-command-extensions/
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}-docs-%{version}.tar.gz

The Group is standard for Python / Django libraries. License is taken from the project’s homepage, source is the standard .tar.gz file which is downloaded from the front page of the project. Source1 is extracted from the github 0.4.1 tag of the project and contains just the documentation to be built.

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python-devel python-sphinx
Requires:       Django

%description
This is a repository for collecting global custom management extensions
for the Django Framework

The buildroot path is standard, arch is noarch (just python code…), the build requires gets the addition of python-sphinx (python documentation generator) which, at buildtime, generates html documentation from .rst files. Obviously runtime requirements are Django, while the description is a copy and paste from the project home page.

%package doc
Summary:        Documentation for django-extensions
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-docs = %{version}-%{release}
Obsoletes:      %{name}-docs < %{version}-%{release}

%description doc
This package contains the documentation for the django-extension library

Wait a minute, what is this? Exactly, we are building not one but two packages. One for code, one for doc.

%prep
%setup -q -n %{name}-%{version}
%setup -a 1

Ok, now things become interesting. According to both the Fedora Project RPM Guide and the Maximum RPM book on rpm.org, the above section reads as: prepare environment; extract first source file silently in a directory named $name-$version (e.g. django-extension-0.4.1), then extract the second source file after changing directory to the newly created directory. This is necessary because I compressed just the docs directory level in the git-donwloaded file.

%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 –skip-build –root $RPM_BUILD_ROOT

(cd docs && make html)

All this stuff comes standard creating an empty python spec file, apart from the last line, which builds the html documentation. This is suggested also by Django spec file (go get it with a yumdownloader –source Django and rpm -ivh the src.rpm).

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{python_sitelib}/*

Standard stuff again.

%files doc
%doc docs

doc packages files

%changelog
* Sun Aug 23 2009 Luca Botti <lucabotti…fedoraproject.org>
- Initial RPM Release

changelog description.

This file is uploaded at my fedorapeople.org’s address and is submitted in bugzilla for review here. I am waiting for sponsorship. Thanks.

More packages will follow. Stay tuned.

About Sudo and Fedora

Saturday, August 1st, 2009

Whenever you read entries about Fedora administration, the common recommendation is to use sudo instead of the root account.

But if you try sudo at the command line, you are met with some error regarding sudo configuration: Fedora does not sudo-enable your account to during system installation, so you are stuck.

What to do is simple:

su -
(insert your root password)
visudo <em> (as per kagesenshi comment #1)</em>

Find a line which says:

root    ALL=(ALL)       ALL

and add

$username ALL=(ALL)     ALL

where $username is the user you log in. That’s all. Ubuntu default behaviour on Fedora.
A variant of this is adding a NOPASSWD tag to avoid requesting for a password every time, though I DO NOT RECOMMEND doing that (gives you time to think about what you are doing); the line becomes:

$username ALL=(ALL)      NOPASSWD: ALL

EDIT – Brian correctly suggests to uncomment the wheel group in /etc/sudoers and add the users to said group; while correct from a sysadmin point of view, I believe we should keep it simple for users that use Fedora “on the Desktop”. I strongly believe Using Fedora and Administering Fedora should be kept as separate activities as possible. Anyway, for more technically oriented users, you can find this way at the fedorasolved.org site.

Home Server – Part Three

Friday, June 12th, 2009

Well, a six month release cycle make me wonder, so instead of keeping my home server up to date with fedora, I decided to give Centos 5.3 a try.

It went…well, apart from a known issue with my motherboard network card. CentOS 5.3 installs all right without complaining, but every few seconds the network card delays the response.

Given that I use the little beast for dhcp, DNS and iscsi, this is not what i was looking for. Luckily enough, after searching for a while, I found the issue (module r8169) and built the r8168 with dkms provided by rpmforge.

Now all is going well. Another addition to the setup, I bought a Western Digital MyBook Studio II for backup and safety purposes. Two disks, one terabyte each, raid 1 setting.

Exported part of it through iscsi for the mac (storage of all digital photos through iPhoto, thanks) and the rest is for me. Connection is fast (esata2), and, anyway, I am using it mostly through WiFi, so anything could be fast enough (except USB 1.1, i think).

Happy? Yes, now I am confident my backups will survive a disk failure. I did not find iscsi-target (IET implementation) in a CentOS 64 bit package, through.

Ten days with Fedora 10

Monday, December 1st, 2008

Last week the nice guys at Fedora released the tenth (X in roman numerals) version of Fedora.

In the previous weekend, I already had installed the preview release on my notebook, as a clean install. It all worked perfectly, marking this version of Fedora the most interesting Linux Distribution release I ever tried.

Fast, beautiful (thanks to Byte-Code colleague Samuele Storari and his Solar theme), this version, while looking similar to older 9 release, feels definitely more polished and performing.

After the release, I yum-upgraded my home server (the Atom 330 I mentioned in the past), and it worked out really fine, with no issues at all. It’s a simpler environment (no gnome, and a initlevel at 3), but everything (iscsi, samba, DNS, DHCP) continued working as before.

On a side note, my iscsi disk is one of two USB disks attached to the server, so I was wondering how to ensure the block device naming and availability. After contemplating custom udev rules, all that was necessary was a look at /dev/disk. I discovered I can access block devices (like disks) through the /dev/disk/by-id, for example.

Really interesting.