]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blob - contrib/packaging/rpm/autorandr.spec
bc4a02b3f7caeb38f768d9bb7de4e23fecad1155
[deb_pkgs/autorandr.git] / contrib / packaging / rpm / autorandr.spec
1 %define name autorandr
2 %define version 1.11
3 %define release 1
4
5 # pmutils
6 %define use_pm_utils 1
7 %if 0%{?fedora} > 22
8 %define use_pm_utils 0
9 %endif
10 %if 0%{?rhel} > 7
11 %define use_pm_utils 0
12 %endif
13
14 # python 2 or 3
15 %define py_ver 3
16 %if 0%{?rhel}
17 %define py_ver 2
18 %endif
19
20 Summary: Automatically select a display configuration based on connected devices
21 Name: %{name}
22 Version: %{version}
23 Release: %{release}%{?dist}
24 Source0: https://github.com/phillipberndt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
25 License: GPLv3
26 Group: Development/Libraries
27 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
28 Prefix: %{_prefix}
29 Vendor: Phillip Berndt <phillip.berndt@googlemail.com>
30 Url: https://github.com/phillipberndt/autorandr
31 Requires: python%{py_ver}
32 %if 0%{?use_pm_utils}
33 Requires:       pm-utils
34 %endif
35 %{?systemd_ordering}
36 BuildRequires: bash-completion
37 BuildRequires: python%{py_ver}-devel
38 BuildRequires: systemd
39 BuildRequires: udev
40 BuildRequires: gcc
41 BuildRequires: libxcb-devel
42 %if %{py_ver} == 2
43 BuildRequires: python3-devel
44 %endif
45
46
47 %description
48 Automatically select a display configuration based on connected devices
49
50 ## Branch information
51
52 This is a compatible Python rewrite of
53 [wertarbyte/autorandr](https://github.com/wertarbyte/autorandr). Contributions
54 for bash-completion, fd.o/XDG autostart, Nitrogen, pm-utils, and systemd can be
55 found under [contrib](contrib/).
56
57 The original [wertarbyte/autorandr](https://github.com/wertarbyte/autorandr)
58 tree is unmaintained, with lots of open pull requests and issues. I forked it
59 and merged what I thought were the most important changes. If you are searching
60 for that version, see the [`legacy` branch](https://github.com/phillipberndt/autorandr/tree/legacy).
61 Note that the Python version is better suited for non-standard configurations,
62 like if you use `--transform` or `--reflect`. If you use `auto-disper`, you
63 have to use the bash version, as there is no disper support in the Python
64 version (yet). Both versions use a compatible configuration file format, so
65 you can, to some extent, switch between them.  I will maintain the `legacy`
66 branch until @wertarbyte finds the time to maintain his branch again.
67
68 If you are interested in why there are two versions around, see
69 [#7](https://github.com/phillipberndt/autorandr/issues/7),
70 [#8](https://github.com/phillipberndt/autorandr/issues/8) and
71 especially
72 [#12](https://github.com/phillipberndt/autorandr/issues/12)
73 if you are unhappy with this version and would like to contribute to the bash
74 version.
75
76
77 %package zsh-completion
78 Summary: zsh-completion for autorandr
79 Requires: zsh
80 Requires: %{name}
81 %description zsh-completion
82 This package provides zsh-completion files for autorandr
83
84 %package launcher
85 Summary: Launcher daemon for autorandr
86 Requires: libxcb
87 Requires: %{name}
88 %description launcher
89 This package provides launcher daemon for autorandr
90
91 %prep
92 %setup -n %{name}-%{version} -n %{name}-%{version}
93 %if %{py_ver} == 3
94 pathfix.py -pni "%{__python3} %{py3_shbang_opts}" ./autorandr.py
95 %else
96 pathfix.py -pni "%{__python2} %{py2_shbang_opts}" ./autorandr.py
97 %endif
98
99 %install
100 make DESTDIR="%{buildroot}" PREFIX=%{_prefix} install
101 make DESTDIR="%{buildroot}" PREFIX=%{_prefix} install_launcher
102 install -vDm 644 README.md -t "%{buildroot}/usr/share/doc/%{name}/"
103 install -vDm 644 contrib/zsh_completion/_autorandr -t %{buildroot}%{_datarootdir}/zsh/site-functions/
104
105
106 %files
107 %defattr(-,root,root,-)
108 %attr(0644,root,root) %{_unitdir}/autorandr.service
109 %license gpl-3.0.txt 
110 %doc README.md
111 %{_sysconfdir}/xdg/autostart/autorandr.desktop
112 %{_bindir}/autorandr
113 %{_mandir}
114 %{_datarootdir}/bash-completion/completions/autorandr
115 %{_udevrulesdir}/40-monitor-hotplug.rules
116
117 %files zsh-completion
118 %{_datarootdir}/zsh/site-functions/_autorandr
119
120 %files launcher
121 %{_bindir}/autorandr-launcher
122 %{_sysconfdir}/xdg/autostart/autorandr-launcher.desktop
123
124 %changelog
125 * Mon Jun 07 2021 Jerzy Drozdz <jerzy.drozdz@jdsieci.pl> - 1.11-1
126 - Updated to stable 1.11
127 - Added launcher subpackage
128 * Mon Jun 08 2020 Jerzy Drozdz <jerzy.drozdz@jdsieci.pl> - 1.10.1-1
129 - Updated to stable 1.10.1
130 - Added zsh-completion subpackage
131 * Wed May 22 2019 Maciej Sitarz <macieksitarz@wp.pl> - 1.8.1-1
132 - Updated to stable 1.8.1
133 * Fri Sep 28 2018 Maciej Sitarz <macieksitarz@wp.pl> - 1.7-1
134 - Updated to stable 1.7
135 * Thu Jul 19 2018 Maciej Sitarz <macieksitarz@wp.pl> - 1.5-1
136 - Updated to stable 1.5
137 - Changed dest path for systemd service file
138 * Sun Oct 01 2017 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 1.1-2
139 - Added conditionals for pm-utils, compability with Fedora26+
140 - Removed bash-completion from requisites
141 - Removed udev from requisites
142 * Sun Sep 03 2017 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 1.1-1
143 - Update to stable 1.1
144 * Fri Feb 17 2017 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 20170217git-1
145 - Update to master
146 * Wed Jul 6 2016 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 20160706git-1
147 - Set default value of $XDG_CONFIG_DIRS to fulfill the standard
148 * Fri Jul 1 2016 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 20160701git-1.1
149 - fixed running udevadm in post
150 * Fri Jul 1 2016 Jerzy Drozdz <rpmbuilder@jdsieci.pl> - 20160701git-1
151 - initial build