You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mosquitto/mosquitto.spec

163 lines
4.1 KiB

12 years ago
Name: mosquitto
Version: 1.3.1
Release: 1%{?dist}
12 years ago
Summary: An Open Source MQTT v3.1 Broker
License: BSD
URL: http://mosquitto.org/
Source0: http://mosquitto.org/files/source/%{name}-%{version}.tar.gz
BuildRequires: openssl-devel
BuildRequires: tcp_wrappers-devel
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: systemd
12 years ago
BuildRequires: uthash-devel
11 years ago
BuildRequires: c-ares-devel
12 years ago
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
Mosquitto is an open source (BSD licensed) message broker that implements the
MQ Telemetry Transport protocol version 3.1. MQTT provides a lightweight
method of carrying out messaging using a publish/subscribe model. This makes
it suitable for "machine to machine" messaging such as with low power sensors
or mobile devices such as phones, embedded computers or micro-controllers
like the Arduino.
%package devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Development files for %{name}
%description devel
Development headers and libraries for %{name}
%package python
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
Summary: Python bindings for %{name}
%description python
Python bindings for %{name}
%prep
%setup -q
# Remove bundled uthash.h
rm -r src/uthash.h
# Set the install prefix to /usr
sed -i "s|prefix=/usr/local|prefix=/usr|" config.mk
# Don't strip binaries on install: rpmbuild will take care of it
sed -i "s|(INSTALL) -s|(INSTALL)|g" lib/Makefile src/Makefile client/Makefile
12 years ago
%build
export CFLAGS="%{optflags}"
export LDFLAGS="%{optflags} %{__global_ldflags} -Wl,--as-needed"
12 years ago
make all %{?_smp_mflags}
pushd lib/python
%{__python2} setup.py build
12 years ago
%install
%if "%{_lib}" == "lib64"
export LIB_SUFFIX=64
%endif
%make_install
pushd lib/python
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
12 years ago
popd
cat > mosquitto.service << FOE
[Unit]
Description=Mosquitto MQTTv3.1 Broker
Documentation=man:mosquitto.conf(5) man:mosquitto(8)
[Service]
ExecStart=/usr/sbin/mosquitto
12 years ago
User=mosquitto
[Install]
WantedBy=multi-user.target
12 years ago
FOE
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -p -m 0644 %{name}.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
%check
#make test
%pre
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_sysconfdir}/%{name} -s /sbin/nologin \
-c "Mosquitto Broker" %{name}
exit 0
%post
%systemd_post %{name}.service
/sbin/ldconfig
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
/sbin/ldconfig
%files
%doc LICENSE.txt readme.txt *.example
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/*.so.*
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/*.example
12 years ago
%{_unitdir}/%{name}.service
%{_mandir}/man1/*.1.*
%{_mandir}/man5/*.5.*
%{_mandir}/man7/*.7.*
%{_mandir}/man8/*.8.*
%files devel
%{_includedir}/*.h
%{_libdir}/*.so
%{_mandir}/man3/*.3.*
%files python
%{python_sitelib}/%{name}*
%changelog
* Sun Apr 06 2014 Rich Mattes <richmattes@gmail.com> - 1.3.1-1
- Update to latest upstream release 1.3.1
* Sat Mar 22 2014 Fabian Affolter <mail@fabian-affolter.ch> - 1.3-1
- Update to latest upstream release 1.3
* Sat Dec 21 2013 Fabian Affolter <mail@fabian-affolter.ch> - 1.2.3-2
- Add install section to service file
* Sat Dec 21 2013 Fabian Affolter <mail@fabian-affolter.ch> - 1.2.3-1
- Update to latest upstream release 1.2.3
* Mon Oct 28 2013 Fabian Affolter <mail@fabian-affolter.ch> - 1.2.2-1
- Update to latest upstream release 1.2.2
* Sat Sep 21 2013 Fabian Affolter <mail@fabian-affolter.ch> - 1.2.1-1
- Update to latest upstream release 1.2.1
* Wed Aug 14 2013 Rich Mattes <richmattes@gmail.com> - 1.2-1
- Update to release 1.2
12 years ago
* Sat Aug 10 2013 Rich Mattes <richmattes@gmail.com> - 1.1.3-3
- Switch to Makefiles from CMake scripts
- Add User=mosquitto to systemd unit
* Tue Jul 23 2013 Rich Mattes <richmattes@gmail.com> - 1.1.3-2
- Unbundle uthash
- Add as-needed to ldflags to avoid spurious links
* Wed May 1 2013 Rich Mattes <richmattes@gmail.com> - 1.1.3-1
- Initial package