Skip to content

Commit

Permalink
Add support for .deb/.rpm packages (#24)
Browse files Browse the repository at this point in the history
Fix #6
Fix #7
This is based on packaging system used by apache/arrow:
https://github.com/apache/arrow/tree/master/dev/tasks/linux-packages
This also change all license headers because we need to
clarify license information to create .deb packages.
The original license headers said ASF is copyright holder
but this project isn't hosted under apache/ organization.
It means that ASF isn't copyright holder.
I replaced all license headers with the standard license
header described in Apache-2.0 License text. And I use
me as the copyright holder because all major changes are
made by me for now.
I prepared CI jobs for arm64 packages but thery are disabled
for now because it's slow. It uses QEMU to build arm64 binaries
on x86_64 GitHub Actions runners.
There are some configurations to release packages but they
aren't tested yet. I'll test them and fix some problem in
a follow-up pull request.
  • Loading branch information
kou committed Aug 19, 2022
1 parent ccd8524 commit 4dac9f2
Show file tree
Hide file tree
Showing 84 changed files with 2,023 additions and 811 deletions.
25 changes: 11 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# http://www.apache.org/licenses/LICENSE-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# http://www.apache.org/licenses/LICENSE-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: CI

Expand Down Expand Up @@ -190,21 +187,21 @@ jobs:
if: |
matrix.runs-on != 'windows-latest'
run: |
build/examples/sql-c
build/example/sql-c
- name: Run Vala example
if: |
matrix.runs-on == 'ubuntu-latest'
run: |
build/examples/sql-vala
build/example/sql-vala
- name: Run Python example
if: |
matrix.runs-on != 'windows-latest'
run: |
cd build
../examples/sql.py
../example/sql.py
- name: Run Ruby example
if: |
matrix.runs-on != 'windows-latest'
run: |
cd build
../examples/sql.rb
../example/sql.rb
163 changes: 163 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Package

on:
- push
- pull_request

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
label:
# - AlmaLinux 8 aarch64
- AlmaLinux 8 x86_64
# - AlmaLinux 9 aarch64
- AlmaLinux 9 x86_64
- Debian GNU/Linux bullseye amd64
# - Debian GNU/Linux bullseye arm64
- Debian GNU/Linux bookworm amd64
# - Debian GNU/Linux bookworm arm64
- Ubuntu Focal amd64
# - Ubuntu Focal arm64
- Ubuntu Jammy amd64
# - Ubuntu Jammy arm64
include:
- label: AlmaLinux 8 x86_64
id: almalinux-8-x86_64
task-namespace: yum
target: almalinux-8
test-docker-image: almalinux:8
# - label: AlmaLinux 8 aarch64
# id: almalinux-8-aarch64
# task-namespace: yum
# target: almalinux-8-aarch64
# test-docker-image: arm64v8/almalinux:8
- label: AlmaLinux 9 x86_64
id: almalinux-9-x86_64
task-namespace: yum
target: almalinux-9
test-docker-image: almalinux:9
# - label: AlmaLinux 9 aarch64
# id: almalinux-9-aarch64
# task-namespace: yum
# target: almalinux-9-aarch64
# test-docker-image: arm64v8/almalinux:9
- label: Debian GNU/Linux bullseye amd64
id: debian-bullseye-amd64
task-namespace: apt
target: debian-bullseye
test-docker-image: debian:bullseye
# - label: Debian GNU/Linux bullseye arm64
# id: debian-bullseye-arm64
# task-namespace: apt
# target: debian-bullseye-arm64
# test-docker-image: arm64v8/debian:bullseye
- label: Debian GNU/Linux bookworm amd64
id: debian-bookworm-amd64
task-namespace: apt
target: debian-bookworm
test-docker-image: debian:bookworm
# - label: Debian GNU/Linux bookworm arm64
# id: debian-bookworm-arm64
# task-namespace: apt
# target: debian-bookworm-arm64
# test-docker-image: arm64v8/debian:bookworm
- label: Ubuntu Focal amd64
id: debian-focal-amd64
task-namespace: apt
target: ubuntu-focal
test-docker-image: ubuntu:focal
# - label: Ubuntu Focal arm64
# id: debian-focal-arm64
# task-namespace: apt
# target: ubuntu-focal-arm64
# test-docker-image: arm64v8/ubuntu:focal
- label: Ubuntu Jammy amd64
id: debian-jammy-amd64
task-namespace: apt
target: ubuntu-jammy
test-docker-image: ubuntu:jammy
# - label: Ubuntu Jammy arm64
# id: debian-jammy-arm64
# task-namespace: apt
# target: ubuntu-jammy-arm64
# test-docker-image: arm64v8/ubuntu:jammy
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Checkout Arrow
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt -V install \
devscripts \
qemu-user-static \
ruby
- name: Update version
if: |
!startsWith(github.ref, 'refs/tags/') &&
!startsWith(github.ref, 'refs/heads/maintenance/')
run: |
cd package
rake version:update RELEASE_DATE=$(date +%Y-%m-%d)
- name: Cache ccache
uses: actions/cache@v2
with:
path: package/${{ matrix.task-namespace }}/build/${{ matrix.target }}/ccache
key: package-${{ matrix.id }}-ccache-${{ hashFiles('datafusion-glib/**/*.{c,h}', 'src/**/*.rs') }}
restore-keys: package-${{ matrix.id }}-ccache-
- name: Build with docker
run: |
cd package
rake ${{ matrix.task-namespace }}:build BUILD_DIR=build
env:
APT_TARGETS: ${{ matrix.target }}
YUM_TARGETS: ${{ matrix.target }}
- uses: actions/upload-artifact@v2
with:
name: package-${{ matrix.id }}
path: package/${{ matrix.task-namespace }}/repositories/
- name: Create assets
if: |
startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p ${{ matrix.id }}
cp -a package/${{ matrix.task-namespace }}/repositories/**/*.* ${{ matrix.id }}/
tar czf ${{ matrix.id }}.tar.gz ${{ matrix.id }}
- name: Upload to release
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ matrix.id }}.tar.gz
- name: Test
run: |
docker run \
--rm \
--volume ${PWD}:/host:ro \
${{ matrix.test-docker-image }} \
/host/package/${{ matrix.task-namespace }}/test.sh
34 changes: 20 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# http://www.apache.org/licenses/LICENSE-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

/Cargo.lock
/target
/package/*.tar.gz
/package/apt/build.sh
/package/apt/env.sh
/package/apt/repositories/
/package/apt/tmp/
/package/yum/build.sh
/package/yum/env.sh
/package/yum/repositories/
/package/yum/tmp/
17 changes: 17 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[submodule "vendor/apache-arrow"]
path = vendor/apache-arrow
url = https://github.com/apache/arrow.git
25 changes: 11 additions & 14 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# -*- ruby -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# http://www.apache.org/licenses/LICENSE-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

brew "apache-arrow-glib"
brew "glib-utils"
Expand Down
27 changes: 12 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# Copyright 2022 Sutou Kouhei <kou@clear-code.com>
#
# http://www.apache.org/licenses/LICENSE-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[package]
name = "datafusion-c"
Expand All @@ -22,7 +19,7 @@ version = "10.0.0"
homepage = "https://github.com/datafusion-contrib/datafusion-c"
repository = "https://github.com/datafusion-contrib/datafusion-c"
readme = "README.md"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
authors = ["Sutou Kouhei <kou@clear-code.com>"]
license = "Apache-2.0"
keywords = ["arrow", "c"]
edition = "2021"
Expand Down
Loading

0 comments on commit 4dac9f2

Please sign in to comment.