File mad-developer.spec of Package mytest3

# spec file for mad-developer

Name:           mad-developer
Version:        2.0
Release:        1.1
License:        GPLv2.1
Summary:        MADDE developer tools
Url:            http://meego.gitorious.org/meego-developer-tools/madde
Group:          Development/Tools
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}.sh
Source2:        remote-wrapper.sh
Patch0:         fix_ftbfs.patch
Patch1:         fix_clean_target.patch
Patch2:         libosso_not_available.patch
Patch3:         use_maemo_definition.patch
BuildRequires:  pkgconfig(QtGui)
%ifarch %{arm}
# Workaround: have choice for libEGL.so.1 needed by libqtgui4: libfgles2 mesa-libEGL
BuildRequires:  mesa-libEGL
%endif
#Requires:       gdb
#Requires:       openssh-server
Requires:       utfs-client

%description
Lightweight and robust way to ease developer access to remote device using
the MeeGo Application Development and Debugging Environment (MADDE).

%prep
%setup -q
# fix_ftbfs.patch
%patch0 -p1
# fix_clean_target.patch
%patch1 -p1
# libosso_not_available.patch
%patch2 -p1
# use_maemo_definition.patch
%patch3 -p1

%build
make %{?_smp_mflags}

%install
make install_maemo DESTDIR=%{buildroot}
# Install mad-developer wrapper script
install -D -p -m 0755 %{_sourcedir}/%{name}.sh %{buildroot}%{_bindir}/%{name}
# Install remote-wrapper.sh script
install -D -p -m 0755 %{_sourcedir}/remote-wrapper.sh \
%{buildroot}%{_libdir}/%{name}/remote-wrapper.sh
# Create symlink to utfs-client
ln -sf %{_bindir}/utfs-client %{buildroot}%{_libdir}/%{name}/utfs-client

%post
LIBDIR=/usr/lib/mad-developer
USER=meego
export HOME=/home/$USER

chmod 555 $LIBDIR/*.sh $LIBDIR/mad-developer $LIBDIR/xterm-shell
chmod 555 $LIBDIR/utfs-client

chown root:$USER $LIBDIR/devrootsh
chmod 4555 $LIBDIR/devrootsh

chown root:root /usr/bin/mad-developer
chmod 4555 /usr/bin/mad-developer

! test -f $HOME/.profile || {
    rm -f $HOME/.profile
    cp $LIBDIR/dot-profile $HOME/.profile
    chown $USER:$USER $HOME/.profile
}

# mad-withhome.sh will add them, remove old if any.
rm -f $HOME/bin/remote-wrapper.sh 2>/dev/null || :
rm -f $HOME/bin/utfs-client 2>/dev/null || :

# for qemu image, create developer home
$LIBDIR/mad-withhome.sh true

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/dbus-1/services/%{name}.service
%{_desktopdir}/hildon/%{name}.desktop
%{_icons64dir}/%{name}.png
%{_libdir}/%{name}/%{name}
%{_libdir}/%{name}/devrootsh
%{_libdir}/%{name}/dot-profile
%{_libdir}/%{name}/help.html
%{_libdir}/%{name}/interfaces.sh
%{_libdir}/%{name}/mad-withhome.sh
%{_libdir}/%{name}/password.sh
%{_libdir}/%{name}/remote-wrapper.sh
%{_libdir}/%{name}/usbdhcpd.sh
%{_libdir}/%{name}/usbmodule.sh
%{_libdir}/%{name}/utfs-client
%{_libdir}/%{name}/xterm-shell
%{_libdir}/%{name}/xterm.sh
%changelog
* Wed Nov 24 2010 Fathi Boudra <fathi.boudra@nokia.com> - 2.0
- Move package to MeeGo Core (BMC#10400)
* Fri Nov  5 2010 Fathi Boudra <fathi.boudra@nokia.com> - 2.0
- Initial mad-developer package (BMC#9732)
openSUSE Build Service is sponsored by