|
1 | | -#!/usr/bin/python3 |
2 | | -# Setup file for initial-setup |
3 | | -# |
4 | | -# Copyright (C) 2020 Red Hat, Inc. |
5 | | -# |
6 | | -# This program is free software: you can redistribute it and/or modify |
7 | | -# it under the terms of the GNU General Public License as published by |
8 | | -# the Free Software Foundation, either version 2 of the License, or |
9 | | -# (at your option) any later version. |
10 | | -# |
11 | | -# This program is distributed in the hope that it will be useful, but |
12 | | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | | -# General Public License for more details. |
15 | | -# |
16 | | -# You should have received a copy of the GNU General Public License |
17 | | -# along with this program. If not, see |
18 | | -# <http://www.gnu.org/licenses/>. |
19 | | -# |
| 1 | +#!/usr/bin/env python3 |
| 2 | +""" |
| 3 | +Minimal setup.py for dynamic configuration that pyproject.toml cannot handle. |
| 4 | +Most configuration is now in pyproject.toml. |
| 5 | +""" |
20 | 6 |
|
21 | 7 | import os |
22 | | -from glob import glob |
23 | | -from setuptools import setup, find_packages |
| 8 | +from setuptools import setup |
24 | 9 |
|
25 | | - |
26 | | -data_files = [('/usr/lib/systemd/system', glob('systemd/*.service')), |
27 | | - ('/etc/initial-setup/conf.d', glob('data/*.conf')), |
28 | | - ('/etc/pam.d', glob('pam/*')), |
29 | | - ('/usr/libexec/initial-setup/', |
30 | | - ["scripts/run-initial-setup", "scripts/firstboot-windowmanager", |
31 | | - "scripts/initial-setup-text", "scripts/initial-setup-graphical", |
32 | | - "scripts/run-gui-backend.guixorg", "scripts/run-gui-backend.guiweston", |
33 | | - "scripts/run-gui-backend", # symlink to the default backend |
34 | | - "scripts/reconfiguration-mode-enabled"]), |
35 | | - ('/usr/share/doc/initial-setup/', ["ChangeLog"])] |
36 | | - |
37 | | -# add the firstboot start script for s390 architectures |
| 10 | +# Handle s390 architecture-specific files dynamically |
| 11 | +data_files = [] |
38 | 12 | if os.uname()[4].startswith('s390'): |
39 | | - data_files.append(('/etc/profile.d', ['scripts/s390/initial-setup.sh'])) |
40 | | - data_files.append(('/etc/profile.d', ['scripts/s390/initial-setup.csh'])) |
41 | | - |
42 | | -with open("README.rst", "r") as f: |
43 | | - long_description = f.read() |
| 13 | + data_files.extend([ |
| 14 | + ('etc/profile.d', ['scripts/s390/initial-setup.sh']), |
| 15 | + ('etc/profile.d', ['scripts/s390/initial-setup.csh']), |
| 16 | + ]) |
44 | 17 |
|
45 | | -setup(name="initial-setup", |
46 | | - version="0.3.101", |
47 | | - author="Martin Kolman", |
48 | | - author_email="mkolman@redhat.com", |
49 | | - description='Post-installation configuration utility', |
50 | | - long_description=long_description, |
51 | | - long_description_content_type="text/x-rst", |
52 | | - url='https://fedoraproject.org/wiki/InitialSetup', |
53 | | - license="GPLv2+", |
54 | | - keywords="firstboot initial setup", |
55 | | - packages=find_packages(), |
56 | | - package_data={ |
57 | | - "": ["*.glade"] |
58 | | - }, |
59 | | - data_files=data_files, |
60 | | - test_suite="initial_setup", |
61 | | - classifiers=[ |
62 | | - "Development Status :: 3 - Alpha", |
63 | | - "Environment :: X11 Applications :: GTK", |
64 | | - "Environment :: Console", |
65 | | - "Intended Audience :: System Administrators", |
66 | | - "Topic :: System :: Systems Administration", |
67 | | - "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", |
68 | | - "Programming Language :: Python :: 3", |
69 | | - ], |
| 18 | +# Call setup with only the dynamic parts |
| 19 | +setup( |
| 20 | + data_files=data_files, |
70 | 21 | ) |
0 commit comments