Skip to content

Commit

Permalink
change mercurial to git in Makefile, fix rpm build, improve rpm spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroslawp committed Jun 26, 2017
1 parent bac6b33 commit 7494119
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions Makefile
Expand Up @@ -11,11 +11,11 @@ PKG_CONFIG ?= pkg-config
MAKENSIS ?= makensis
MAKERPM ?= rpmbuild
RPMDIR ?= $(shell pwd)/rpmdir
RPMSPEC = purple-mattermost.spec

REVISION_ID = $(shell hg id -i)
REVISION_NUMBER = $(shell hg id -n)
ifneq ($(REVISION_ID),)
PLUGIN_VERSION ?= 1.1.$(shell date +%Y.%m.%d).git.r$(REVISION_NUMBER).$(REVISION_ID)
COMMIT_ID = $(shell git log -1 --pretty=format:"%h")
ifneq ($(COMMIT_ID),)
PLUGIN_VERSION ?= 1.1.$(shell date +%Y.%m.%d).git.$(COMMIT_ID)
else
PLUGIN_VERSION ?= 1.1.$(shell date +%Y.%m.%d)
endif
Expand Down Expand Up @@ -110,16 +110,19 @@ installer: purple-mattermost.nsi libmattermost.dll mattermost16.png mattermost22
$(MAKENSIS) purple-mattermost.nsi


rpm:
rpm: clean
mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS}
tar -czf $(RPMDIR)/SOURCES/purple-mattermost-$(PLUGIN_VERSION).tar.gz --exclude-vcs --transform 's|^\.|purple-mattermost-$(PLUGIN_VERSION)|' .
$(MAKERPM) -ta $(RPMDIR)/SOURCES/purple-mattermost-$(PLUGIN_VERSION).tar.gz --define 'plugin_version $(PLUGIN_VERSION)' --define '_topdir $(RPMDIR)'
cp $(RPMSPEC).in $(RPMSPEC)
sed -i 's|@PLUGIN_VERSION@|$(PLUGIN_VERSION)|' $(RPMSPEC)
tar -czf $(RPMDIR)/SOURCES/purple-mattermost-$(PLUGIN_VERSION).tar.gz --exclude-vcs --transform 's|^\.|purple-mattermost-$(PLUGIN_VERSION)|' --exclude purple-mattermost-$(PLUGIN_VERSION).tar.gz --exclude $(RPMSPEC).in .
$(MAKERPM) -ta $(RPMDIR)/SOURCES/purple-mattermost-$(PLUGIN_VERSION).tar.gz --define '_topdir $(RPMDIR)'

FAILNOPURPLE:
echo "You need libpurple development headers installed to be able to compile this plugin"

clean:
rm -f $(MATTERMOST_TARGET)
rm -rf $(RPMDIR)
rm -f $(RPMSPEC)


8 changes: 4 additions & 4 deletions purple-mattermost.spec → purple-mattermost.spec.in
@@ -1,4 +1,4 @@
%{!?plugin_version: %define plugin_version 1.1}
%{!?plugin_version: %define plugin_version @PLUGIN_VERSION@}

Name: purple-mattermost
Version: %{plugin_version}
Expand All @@ -15,8 +15,7 @@ Source0: https://github.com/EionRobb/purple-mattermost/archive/v%{version
# package version as available on RHEL7/EPEL7
BuildRequires: json-glib-devel >= 1.0.2
BuildRequires: libmarkdown-devel >= 2.1.8
BuildRequires: libpurple-devel >= 2.8.0
BuildRequires: mercurial >= 2.6.2
BuildRequires: libpurple-devel >= 2.10.7

%description
A third-party plugin for the Pidgin multi-protocol instant messenger.
Expand Down Expand Up @@ -53,7 +52,8 @@ rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc INSTALL.md LICENSE README.md VERIFICATION.md
%license LICENSE
%doc INSTALL.md README.md VERIFICATION.md
%{_libdir}/purple-*/libmattermost.so

%files -n pidgin-mattermost
Expand Down

0 comments on commit 7494119

Please sign in to comment.